Selenium Webdriver Click Skips Some Checkboxes
This is a follow-up question to this: WebDriver element found, but click returns nothing I am trying to scrape data from the URL in the code after making selections in the drop-dow
Solution 1:
Before clicking on the checkbox, check that is already selected or not:
# Check the road wise box.
time.sleep(10)
checkElem = WebDriverWait(browser, 120).until(EC.element_to_be_clickable((By.XPATH, "//input[@title='Road Wise']")))
if checkElem.is_selected() != True:
browser.execute_script("arguments[0].click();", checkElem)
PS: In your case, the click will be only in the first iteration of the loop.
Post a Comment for "Selenium Webdriver Click Skips Some Checkboxes"