I'm trying to set some features on a page to download data automatically from a website. The problem is that I can't set the dates correctly from a calender.
I've tried setting the xpath, using the function 'find_element_by_xpath' but it doesn't seem to work.
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support.ui import WebDriverWait
browser.get("http://www.aguacanal.es/regantes/")
select = Select(browser.find_element_by_id('sectorSelect'))
# select by visible text
select.select_by_visible_text('Sector III')
select = Select(browser.find_element_by_id('hidranteSelect'))
# select by visible text
select.select_by_visible_text('H03.156')
nav = browser.find_element_by_id('hidConDi-btn')
nav.click()
#---DatePicker
datefield = browser.find_element_by_id('hidConDi-fechaIni').click()
datefield.send_keys("01012019")
datefield = browser.find_element_by_id('hidConDi-fechaFin').click()
datefield.send_keys("03012019")
With this code I can select the current date, but I can't make it work correctly when I tried to set new dates.