Answer the question
In order to leave comments, you need to log in
How to click on checkbox using selenium python?
Good afternoon. I ran into a problem when trying to auto-tick the checkbox using selenium.
Site https://service.nalog.ru/static/personal-data.html
I try to check this box
but I get an error: selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
My code:
from selenium import webdriver
driver = webdriver.Chrome()
driver.get('https://service.nalog.ru/static/personal-data.html')
driver.find_element_by_id('personalData').click()
Answer the question
In order to leave comments, you need to log in
You may need to click on the parent. For example, if the checkbox is in a div, try clicking on the div.
Or in your case click on #unichk_0
Alternatively, click using javascript:
driver.execute_script("document.getElementById('personalData').checked = true")
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question