Home >Backend Development >Python Tutorial >Why Does Selenium WebDriver Throw 'unable to obtain {service.path} using Selenium Manager'?
When attempting to instantiate a Selenium WebDriver object, some developers may encounter the following error:
"unable to obtain {service.path} using Selenium Manager; 'str' object has no attribute 'capabilities'"
This error can be traced back to issues with Selenium Manager in conjunction with newer versions of Selenium (v4.6.0 and above). The root cause lies in attempting to set the driver.exe path manually.
Solution:
In newer versions of Selenium, the WebDriver manager capability has been enhanced, eliminating the need for manual driver path specification. To resolve the issue, simplify your code by removing the driver.exe path:
from selenium import webdriver driver = webdriver.Chrome() # Automatically handles browser and driver driver.get("https://www.google.com/") driver.quit()
References:
The above is the detailed content of Why Does Selenium WebDriver Throw 'unable to obtain {service.path} using Selenium Manager'?. For more information, please follow other related articles on the PHP Chinese website!