Hello! It keeps giving me an error, any ideas!
`D:\bot>1.py
DevTools listening on ws://127.0.0.1:58162/devtools/
Traceback (most recent call last):
File "D:\bot\1.py", line 7, in
browser.find_by_name('btnI').click()
File "C:\Program Files\Python311\Lib\site-packages
raise error
File "C:\Program Files\Python311\Lib\site-packages
return self._element.click()
^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\site-packages
self._execute(Command.CLICK_ELEMENT)
File "C:\Program Files\Python311\Lib\site-packages
return self._parent.execute(command, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\site-packages
self.error_handler.check_response(response)
File "C:\Program Files\Python311\Lib\site-packages
raise exception_class(message, screen, stacktrac
selenium.common.exceptions.ElementNotInteractableExc
(Session info: chrome=109.0.5414.120)
Stacktrace:
Backtrace:
(No symbol) [0x00566643]
(No symbol) [0x004FBE21]
(No symbol) [0x003FD960]
(No symbol) [0x004323A7]
(No symbol) [0x00426B13]
(No symbol) [0x0044FD7C]
(No symbol) [0x0042641F]
(No symbol) [0x004500D4]
(No symbol) [0x00466B09]
(No symbol) [0x0044FB76]
(No symbol) [0x004249C1]
(No symbol) [0x00425E5D]
GetHandleVerifier [0x007DA142+2497106]
GetHandleVerifier [0x008085D3+2686691]
GetHandleVerifier [0x0080BB9C+2700460]
GetHandleVerifier [0x00613B10+635936]
(No symbol) [0x00504A1F]
(No symbol) [0x0050A418]
(No symbol) [0x0050A505]
(No symbol) [0x0051508B]
BaseThreadInitThunk [0x76143D12+18]
RtlInitializeExceptionChain [0x77E79732+99]
RtlInitializeExceptionChain [0x77E79705+54]`
My file 1.py
`from splinter import Browser
browser = Browser('chrome')
browser.visit('https://www.google.com/')
browser.find_by_name('q').fill('splinter - python acceptance testing for web applications')
browser.find_by_name('btnI').click()
#browser.find_by_name('btnI').first.click()
#browser.find_by_css('input.gNO89b').first.click()
if browser.is_text_present('splinter.readthedocs.io'):
print("Yes, the official website was found!")
else:
print("No, it wasn't found... We need to improve our SEO techniques")
browser.quit()`
Your error is:
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
This is occurring because the element is not interactable.
An element with the name btnI is found twice on the page, of which the first occurrence is hidden.
Ваша ошибка: selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
Это происходит потому, что элемент не является интерактивным.
Элемент с именем btnIвстречается на странице дважды, причем первое вхождение скрыто.
Thank you very much for the answer! I figured it out, although I don’t understand why this error occurs, all elements are visible