Good day to all,
I am making a program to open a specific page in Chrome, when calling “chromedriver” I get the following error:
`from selenium import webdriver
driver = webdriver.Chrome('webdriver//chromedriver.exe')`
--------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[4], line 1
----> 1 driver = webdriver.Chrome('webdriver//chromedriver.exe')
File ~AppDataLocalProgramsPythonPython312Libsite- packagesseleniumwebdriverchromewebdriver.py:45, in WebDriver.__init__(self, options, service, keep_alive)
42 service = service if service else Service()
43 options = options if options else Options()
---> 45 super().__init__(
46 browser_name=DesiredCapabilities.CHROME["browserName"],
47 vendor_prefix="goog",
48 options=options,
49 service=service,
50 keep_alive=keep_alive,
51 )
File ~AppDataLocalProgramsPythonPython312Libsite- packagesseleniumwebdriverchromiumwebdriver.py:50, in ChromiumDriver.__init__(self, browser_name, vendor_prefix, options, service, keep_alive)
47 self.service = service
49 finder = DriverFinder(self.service, options)
---> 50 if finder.get_browser_path():
51 options.binary_location = finder.get_browser_path()
52 options.browser_version = None
File ~AppDataLocalProgramsPythonPython312Libsite- packagesseleniumwebdrivercommondriver_finder.py:47, in DriverFinder.get_browser_path(self)
46 def get_browser_path(self) -> str:
---> 47 return self._binary_paths()["browser_path"]
File ~AppDataLocalProgramsPythonPython312Libsite- packagesseleniumwebdrivercommondriver_finder.py:56, in DriverFinder._binary_paths(self)
53 if self._paths["driver_path"]:
54 return self._paths
---> 56 browser = self._options.capabilities["browserName"]
57 try:
58 path = self._service.path
AttributeError: 'str' object has no attribute 'capabilities'
como puedo solucionar este error, agradezco mucho su colaboración.
New contributor
Elkin Rivera is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.