Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python selenium element not interactable when bot tries to click agreement button

<input id="agreement-input-mobile" class="agreement-input" type="checkbox" name="agreement" aria-describedby="agreement-content">

im trying to automate a certain task but it needs to click an agreement button but every time I try to select it I get this error

 selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
  (Session info: chrome=87.0.4280.67)

here's what my line of code looks like

driver.find_element_by_name('agreement').click()

1 Answers

I wouldn't recommend to find elements by name. Use ID or xpath. So change driver.find_element_by_name('agreement').click() to driver.find_element_by_id('agreement-input-mobile').click()

like image 156
SmokeyTube Avatar answered Aug 01 '26 08:08

SmokeyTube



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!