Using selenium on calendar date picker
<p>I am trying to pick a date (01/01/2011) from a calendar on this page. <a href="https://cotthosting.com/NYRocklandExternal/LandRecords/protected/SrchQuickName.aspx" rel="nofollow">https://cotthosting.com/NYRocklandExternal/LandRecords/protected/SrchQuickName.aspx</a></p>

<p>The calendar is on the part of the form that says <code>Date: FROM</code>. When I click it, a calendar pops up for you to pick dates. However, the field also allows you type in a date. Given the complexity of calendars, I have chosen to use <code>send_keys()</code> but it is not working.</p>

<p>I have identified the empty field date field by its ID but for some reason it does not fill the form. when I try:</p>

<pre><code>driver.find_element_by_id('ctl00_cphMain_SrchDates1_txtFiledFrom').send_keys("01012011")
</code></pre>

<p>Any ideas on how I can maneuver it differently? I'm using Python 2.7 with Selenium and ChromeDriver</p>

<p>I use Actions Class in Java .
The Java code which ran successfully is as belows: </p>

<pre><code>package stackoverflow;

public class question1 {

@Test
public void a () throws InterruptedException{

    System.setProperty("webdriver.chrome.driver", "D:\\Selenium\\CP-SAT\\Chromedriver\\chromedriver.exe");
    WebDriver a = new ChromeDriver();
    a.manage().window().maximize();
    a.get("https://cotthosting.com/NYRocklandExternal/LandRecords/protected/SrchQuickName.aspx");
    Thread.sleep(2000L);
    a.findElement(By.id("ctl00_cphMain_blkLogin_btnGuestLogin")).click();
    Thread.sleep(2000L);
    a.findElement(By.id("ctl00_cphMain_SrchDates1_txtFiledFrom")).click();
    Actions b = new Actions(a);
    for (int i = 0;i&lt;6 ;i++){
        for(int j = 0; j&lt;6; j++){   
                WebElement c = a.findElement(By.xpath("//*[@id='ctl00_cphMain_SrchDates1_ceFiledFrom_day_"+ i + "_" + j + "']"));
                Thread.sleep(2000L);
                b.moveToElement(c).build().perform();
            }
        }
    }
}
</code></pre>

<p>I tried to convert it for you in python, but I'm not sure about the syntax.
Below is the code:</p>

<pre><code>    a.get("https://cotthosting.com/NYRocklandExternal/LandRecords/protected/SrchQuickName.aspx");
    a.implicitly_wait(3);
    a.find_element_by_id("ctl00_cphMain_blkLogin_btnGuestLogin").click();
    a.implicitly_wait(3);
    a.find_element_by_id("ctl00_cphMain_SrchDates1_txtFiledFrom").click();
    actions = ActionChains(a);
    for (int i = 0;i&lt;6 ;i++){
        for(int j = 0; j&lt;6; j++){   
                WebElement c = a.find_element_by_xpath("//*[@id='ctl00_cphMain_SrchDates1_ceFiledFrom_day_"+ i + "_" + j + "']");
                a.implicitly_wait(3);
                actions.move_to_element(c).perform();

            }
        }
</code></pre>

<p>Try it at your end and let me know for further issues.
Happy learning :-)</p>

python selenium datepicker