When I want to send_keys to a readonly datepicker, I failed to input the date. Here is thelink I try to remove the readonly first, clear, and send_keys.
url="https://epaper.oeeee.com/epaper/A/html/2018-02/06/node_2637.htm"
driver.get(url)
d=driver.find_element_by_xpath("/html/body/div[1]/div/div[2]/input")
driver.execute_script('arguments[0].removeAttribute(\"readonly\")', d)
driver.find_element_by_xpath('/html/body/div[1]/div/div[2]/input').clear()
d.send_keys('2018-02-02')
d.send_keys(Keys.RETURN)
Could anyone tell me why?
Many thanks