I am trying to input date on a web page using selenium. I've used the code as follows:
from selenium import webdriver
driver = webdriver.Firefox()
driver.get('https://www.nccpl.com.pk/en/market-information/fipi-lipi/lipi-sector-wise-daily')
datefield = driver.find_element_by_id('popupDatepicker')
datefield = driver.find_element_by_name('value')
datefield.click()
datefield.send_keys("01/01/2019")
I am unable to plug in the desired date "01/01/2019"
. I searched for similar solutions and found this link.
As suggested in the above mentioned solution I tried using ActionChains
to perform one task after another but still I was unable to change the date. The piece of code used to perform ActionChains is as follows:
ActionChains(driver).move_to_element(datefield).click().send_keys('01/01/2019').perform()
Any idea if I am doing something wrong or how can I get it working?