I'm trying to click the one-way button on this site. I'm waiting for the button to be clickable, but the script times out. Here's the code:
with webdriver.Chrome() as driver:
driver.get("https://www.united.com/en/us")
WebDriverWait(driver, 5).until(EC.element_to_be_clickable((By.CSS_SELECTOR, '#oneway'))).click()
Thanks!
I made the script work by using the label in-place of the input itself:
WebDriverWait(driver, 5).until(EC.element_to_be_clickable((By.CSS_SELECTOR, '[for="oneway"]'))).click()
But I'm not able to understand why the first approach doesn't work.