Я не смог найти и щелкнуть элемент. HTML выглядит следующим образом:
<button _ngcontent-c2=""> INICIAR SESIÓN </button>
Я пытался использовать код:
login_element = driver.find_element_by_xpath('/html/body/app-root/div/div/app-login/form/div/div/button').click()
Это ошибка, которую я получил:
Traceback (most recent call last):
File "/home/eitan/PycharmProjects/pysel/autopro.py", line 36, in <module>
login_element = driver.find_element_by_xpath('/html/body/app-root/div/div/app-login/form/div/div/button').click()
File "/home/eitan/PycharmProjects/pysel/venv/lib/python3.6/site-packages/selenium/webdriver/remote/webelement.py", line 80, in click
self._execute(Command.CLICK_ELEMENT)
File "/home/eitan/PycharmProjects/pysel/venv/lib/python3.6/site-packages/selenium/webdriver/remote/webelement.py", line 633, in _execute
return self._parent.execute(command, params)
File "/home/eitan/PycharmProjects/pysel/venv/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/home/eitan/PycharmProjects/pysel/venv/lib/python3.6/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 <button _ngcontent-c2="">...</button> is not clickable at point (624, 648). Other element would receive the click: <img _ngcontent-c2="" src="assets/static/images/login.svg">
(Session info: chrome=74.0.3729.131)
(Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Linux 4.15.0-47-generic x86_64)