[Python] Selenium python how I preform a click on toggle button

Discussão em 'Python' iniciado por Stack, Fevereiro 16, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to click in call loop toggle with Selenium with the WebDriver on Python.

    the html code:

    [​IMG]

    this is the button:

    [​IMG]

    I have tried few options:

    button_element = driver.find_element_by_class_name("iPhoneCheckContainer")
    button_element.click()


    the filed message:

    Traceback (most recent call last):
    File "C:\Users\kosti\PycharmProjects\test1\main.py", line 50, in <module>
    element = driver.find_element_by_xpath("//input[@id='on_off_on']").click()
    File "C:\Users\kosti\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 80, in click
    self._execute(Command.CLICK_ELEMENT)
    File "C:\Users\kosti\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute
    return self._parent.execute(command, params)
    File "C:\Users\kosti\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
    File "C:\Users\kosti\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
    selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element <input type="checkbox" id="on_off_on" value="1" name="AllowReset" checked=""> is not clickable at point (171, 261). Other element would receive the click: <div class="iPhoneCheckHandle" style="width: 30px; left: 30px;">...</div>
    (Session info: chrome=88.0.4324.150)

    Continue reading...

Compartilhe esta Página