Skip to content Skip to sidebar Skip to footer

Python Selenium Date Picker

Im trying to get the current active day on the calendar. when i use this: driver.find_element_by_xpath('//a[@class='ui-state-default ui-state-highlight ui-state-active']') it cant

Solution 1:

Without seeing the original HTML code this is a bit of a presumptive answer, but should work:

driver.find_element_by_xpath(".//*[@id='ui-datepicker-div']/table/tbody/tr/td/a[contains(@class, 'ui-state-active')]")

This will find the first anchor element within any row within that table. You could narrow this down further still, but this should accomplish what you're looking to do.

Post a Comment for "Python Selenium Date Picker"