I run a campsite and I'm using Selenium to navigate through my booking system to extract some info. The page I'm trying to navigate has input fields with type=text
which is equipped with a date-picker. When I attempt to select the field and use the .send_keys()
method, chrome seems to crash. I have also tried to use the .clear()
function and manually send the DELETE key x times to clear the field. On each attempt, chrome crashes when I try to clear the last character in the field.
frame = driver.find_element_by_name('theFrame')
driver.switch_to.frame(frame)
print("frame detected")
wait.until((EC.presence_of_element_located((By.NAME, "from"))))
print("from element detected")
sleep(5)
fromfield = driver.find_element_by_name("from")
fromfield.send_keys(f'{yesterday}')
tofield = driver.find_element_by_name("to")
tofield.send_keys(f'{yesterday}')
Is the only way around this to code selenium to operate the date-picker? I can do this, it's just a bit of a pain in the arse and I've not seen this clear = crash issue mentioned elsewhere so wonder whether it's something I'm doing wrong.
Edit: Just to clarify, the page generally seems to crash when this field is cleared. It's not just when using selenium.
Cheers, Simon