I\'m trying to select a date form a calendar with python and selenium but I need some help, I did this in VBA but I want to do this in python. Thanks in advance.
The field associated with the
Date of Birth is having the attribute readonly. So to invoke
send_keys()
you have to:
execute_script()
to remove the readonly
attribute.send_keys()
to send the date.You can use the following solution:
Code Block:
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
driver.get("https://burghquayregistrationoffice.inis.gov.ie/Website/AMSREG/AMSRegWeb.nsf/AppSelect?OpenForm")
dob = driver.find_element_by_css_selector("input#DOB")
driver.execute_script("window.scrollBy(0, 400)")
driver.execute_script("arguments[0].removeAttribute('readonly')", dob);
driver.find_element_by_css_selector("input#DOB").send_keys("10/08/2019")
Browser Snapshot: