0

I am trying to get daily data from Google trends using Selenium.

Therefore, I need to Input the start and end date in both boxes. For the start date, I use the following which works fine:

elem4 = browser.find_element_by_class_name("md-datepicker-input")
elem4.clear()
elem4.send_keys("01/01/2018")

However, the second box has the same class name 'md-datepicker-input'. Picking it via xpath also doesnt work...

Has anyone an idea how to select that box, clear it and input my data?

Example custom period

MANGo 92
  • 81
  • 1
  • 8

1 Answers1

0

Here is the CSS that you should use for To date.

.custom-date-picker-dialog-range-to .md-datepicker-inpt

enter image description here

If you want to use xpath

//div[@class='custom-date-picker-dialog-range-to']//input[@class='md-datepicker-input']

enter image description here

supputuri
  • 13,644
  • 2
  • 21
  • 39