Cześć,
Próbuję otworzyć stronę za pomocą webdrivera z biblioteki selenium.
from selenium import webdriver
url = "https://www.wp.pl"
driver = webdriver.Edge("C:\\Users\\zbiku\\Desktop\\edgedriver_win64\\msedgedriver.exe")
driver.get(url)
Sterownik i ścieżka są prawidłowe.
Otrzymuję poniższy błąd i nie wiem z czego wynika. Czy ktoś wie o co chodzi?
Traceback (most recent call last):
File "C:\Users\zbiku\AppData\Roaming\Python\Python311\site-packages\selenium\webdriver\common\driver_finder.py", line 38, in get_path
path = SeleniumManager().driver_location(options) if path is None else path
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zbiku\AppData\Roaming\Python\Python311\site-packages\selenium\webdriver\common\selenium_manager.py", line 71, in driver_location
browser = options.capabilities["browserName"]
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'capabilities'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\Users\zbiku\Desktop\ćwiczenia programowe\viewer", line 5, in <module>
driver = webdriver.Edge("C:\\Users\\zbiku\\Desktop\\edgedriver_win64\\msedgedriver.exe")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zbiku\AppData\Roaming\Python\Python311\site-packages\selenium\webdriver\edge\webdriver.py", line 45, in __init__
super().__init__(
File "C:\Users\zbiku\AppData\Roaming\Python\Python311\site-packages\selenium\webdriver\chromium\webdriver.py", line 51, in __init__
self.service.path = DriverFinder.get_path(self.service, options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zbiku\AppData\Roaming\Python\Python311\site-packages\selenium\webdriver\common\driver_finder.py", line 40, in get_path
msg = f"Unable to obtain driver for {options.capabilities['browserName']} using Selenium Manager."
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'capabilities'
PS C:\Users\zbiku>