How to select a checkbox with Selenium WebDriver in Python

Viewed 19

I'm a real noob and I started to learn Python a few weeks ago.

I need to create an automation for eCommerce, I need to log in, select a page, **select a checkbox ** and click the button "submit". It seems very simple I know but on this website, the normal procedure doesn't work:

This is the HTML code:

<div class="loader-container"\>
<table class="table-grey table__orders table"\>
<thead\>
<th class="check-all table__orders-checker"\>
*\*\<div class="check-all__box"\>
<input type="checkbox" value="checkAll"\>\*\*
</div\>

This is what I coded to click the "check all" checkbox:

driver.find_element(
    By.xpath, "//div[contains(@class, 'loader-container')]/table/thead/tr/th/div/input[@type='checkbox']").click()

I've tried also:

WebDriverWait(driver, 30).until(EC.element_to_be_clickable(
    By.XPATH, "//div[contains(@class, 'loader-container')]/table/thead/tr/th/div/input[@type='checkbox']")).click()

Both without success, nothing happens when it should click this checkbox, I've also other try looking on this forum or YouTube but I'm missing something because I can't fix it.

Thank you in advance for your patience!

0 Answers
Related