How to Select date from a datepicker with Selenium Webdriver using Python

0 votes
How to Select date from a datepicker with Selenium Webdriver using Python?
Jul 31, 2019 in Selenium by Yashim
10,944 views

1 answer to this question.

0 votes

Hi Yashim, you can select date from a datepicker using following piece of code:

driver = webdriver.FirefoxDriver();

driver.get("http://jqueryui.com/datepicker/");

driver.switchTo().frame(0);

driver.implicitly_wait(2)
driver.maximize_window()

driver.findElement(By.id("datepicker")).click();
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);

dateWidget = driver.find_element_by_id("ui-datepicker-div")
rows = dateWidget.find_elements_by_tag_name("tr")
columns = dateWidget.find_elements_by_tag_name("td")

for cell in columns:
    if cell.gettext().equal('10'):
        cell.find_element_by_link_text('10').click()
        break


This should work.

To know more, It's recommended to join our Python Training in Chennai today.

answered Jul 31, 2019 by Abha
• 28,140 points

edited Oct 7, 2021 by Sarfaraz

Related Questions In Selenium

0 votes
1 answer
0 votes
2 answers
0 votes
1 answer

How to login a forum using Selenium with Python

You should try to directly log in ...READ MORE

answered Apr 27, 2018 in Selenium by Samarpit
• 5,910 points
2,754 views
0 votes
2 answers

How to open a browser window in full screen using Selenium WebDriver with C#

Hi , we have inbuilt method Maximize(). driver.Manage().Wind ...READ MORE

answered Sep 6, 2020 in Selenium by Sri
• 3,190 points
16,031 views
0 votes
1 answer

Installing Selenium Webdriver with Python package

Hey Hemant, for installing Selenium Webdriver with ...READ MORE

answered May 8, 2019 in Selenium by Anvi
• 14,150 points
15,837 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
13,673 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,142 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,910 points
7,221 views
0 votes
1 answer

How can I select date from a datepicker div using Selenium Webdriver?

Hey Jeevika, you can use following automation ...READ MORE

answered Jul 15, 2019 in Selenium by Abha
• 28,140 points
12,178 views
+1 vote
4 answers

How to get typed text from a textbox by using Selenium Webdriver?

Hey Ashmita, to get the typed text ...READ MORE

answered Jun 25, 2019 in Selenium by Abha
• 28,140 points
39,881 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP