• Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

Python Browser Automation with Selenium

kaliber

New Coder
After I run the code my webbrowser and the pinterest website opens, but nothing more. The Button from which I got the id won't be clicked. Does anybody what I did wrong?
This is the code:

import os # zur Benutzung der Pathfunktion
from selenium import webdriver # importierung von Selenium, welches sehr wichtig zur Automatisierung ist

os.environ['PATH'] += r"C:\Users\Karl\PycharmProjects\pythonAutomation\chrome-win64" # Gibt den Dateienpfad an wo der jeweilige driver gespeichert wird
driver = webdriver.Chrome() # legt fest das der Webdriver der Chromedriver ist
driver.get("Pinterest") # Webseite die geöffnet werden soll
driver.implicitly_wait(10) # wartet bis die Seite fertig geladen hat
my_element = driver.find_element(by="id", value='mweb-unauth-container')
driver.implicitly_wait(8)
my_element.click()
driver.implicitly_wait(8)

Thank you really much for any help.
This is the failure code I got:

Traceback (most recent call last):
File "C:\Users\Karl\PycharmProjects\pythonAutomation\BrowserAutomation_Grundlagen.py", line 10, in <module>
my_element.click()
File "C:\Users\Karl\PycharmProjects\pythonAutomation\venv\Lib\site-packages\selenium\webdriver\remote\webelement.py", line 94, in click
self._execute(Command.CLICK_ELEMENT)
File "C:\Users\Karl\PycharmProjects\pythonAutomation\venv\Lib\site-packages\selenium\webdriver\remote\webelement.py", line 395, in _execute
return self._parent.execute(command, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Karl\PycharmProjects\pythonAutomation\venv\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 345, in execute
self.error_handler.check_response(response)
File "C:\Users\Karl\PycharmProjects\pythonAutomation\venv\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 229, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable: element has zero size
(Session info: chrome=116.0.5845.111)
Stacktrace:
GetHandleVerifier [0x00007FF6931A52A2+57122]
(No symbol) [0x00007FF69311EA92]
(No symbol) [0x00007FF692FEE3AB]
(No symbol) [0x00007FF69302909A]
(No symbol) [0x00007FF69301F25F]
(No symbol) [0x00007FF693046FDA]
(No symbol) [0x00007FF69301EB76]
(No symbol) [0x00007FF6930471F0]
(No symbol) [0x00007FF69305EB82]
(No symbol) [0x00007FF693046DB3]
(No symbol) [0x00007FF69301D2B1]
(No symbol) [0x00007FF69301E494]
GetHandleVerifier [0x00007FF69344EF82+2849794]
GetHandleVerifier [0x00007FF6934A1D24+3189156]
GetHandleVerifier [0x00007FF69349ACAF+3160367]
GetHandleVerifier [0x00007FF693236D06+653702]
(No symbol) [0x00007FF69312A208]
(No symbol) [0x00007FF6931262C4]
(No symbol) [0x00007FF6931263F6]
(No symbol) [0x00007FF6931167A3]
BaseThreadInitThunk [0x00007FFF59BC7614+20]
RtlUserThreadStart [0x00007FFF5AC026B1+33]
 
After I run the code my webbrowser and the pinterest website opens, but nothing more. The Button from which I got the id won't be clicked. Does anybody what I did wrong?
This is the code:

import os # zur Benutzung der Pathfunktion
from selenium import webdriver # importierung von Selenium, welches sehr wichtig zur Automatisierung ist

os.environ['PATH'] += r"C:\Users\Karl\PycharmProjects\pythonAutomation\chrome-win64" # Gibt den Dateienpfad an wo der jeweilige driver gespeichert wird
driver = webdriver.Chrome() # legt fest das der Webdriver der Chromedriver ist
driver.get("Pinterest") # Webseite die geöffnet werden soll
driver.implicitly_wait(10) # wartet bis die Seite fertig geladen hat
my_element = driver.find_element(by="id", value='mweb-unauth-container')
driver.implicitly_wait(8)
my_element.click()
driver.implicitly_wait(8)

Thank you really much for any help.
This is the failure code I got:

Traceback (most recent call last):
File "C:\Users\Karl\PycharmProjects\pythonAutomation\BrowserAutomation_Grundlagen.py", line 10, in <module>
my_element.click()
File "C:\Users\Karl\PycharmProjects\pythonAutomation\venv\Lib\site-packages\selenium\webdriver\remote\webelement.py", line 94, in click
self._execute(Command.CLICK_ELEMENT)
File "C:\Users\Karl\PycharmProjects\pythonAutomation\venv\Lib\site-packages\selenium\webdriver\remote\webelement.py", line 395, in _execute
return self._parent.execute(command, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Karl\PycharmProjects\pythonAutomation\venv\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 345, in execute
self.error_handler.check_response(response)
File "C:\Users\Karl\PycharmProjects\pythonAutomation\venv\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 229, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable: element has zero size
(Session info: chrome=116.0.5845.111)
Stacktrace:
GetHandleVerifier [0x00007FF6931A52A2+57122]
(No symbol) [0x00007FF69311EA92]
(No symbol) [0x00007FF692FEE3AB]
(No symbol) [0x00007FF69302909A]
(No symbol) [0x00007FF69301F25F]
(No symbol) [0x00007FF693046FDA]
(No symbol) [0x00007FF69301EB76]
(No symbol) [0x00007FF6930471F0]
(No symbol) [0x00007FF69305EB82]
(No symbol) [0x00007FF693046DB3]
(No symbol) [0x00007FF69301D2B1]
(No symbol) [0x00007FF69301E494]
GetHandleVerifier [0x00007FF69344EF82+2849794]
GetHandleVerifier [0x00007FF6934A1D24+3189156]
GetHandleVerifier [0x00007FF69349ACAF+3160367]
GetHandleVerifier [0x00007FF693236D06+653702]
(No symbol) [0x00007FF69312A208]
(No symbol) [0x00007FF6931262C4]
(No symbol) [0x00007FF6931263F6]
(No symbol) [0x00007FF6931167A3]
BaseThreadInitThunk [0x00007FFF59BC7614+20]
RtlUserThreadStart [0x00007FFF5AC026B1+33]
Hi there,
Can you walk me through what your code does? I think I may have missed context in your explanation.
 
Top Bottom