SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
30.42k stars 8.15k forks source link

[🐛 Bug]: SeleniumManagerException AND WebDriverException #11753

Closed knnthchng closed 1 year ago

knnthchng commented 1 year ago

What happened?

I'm running a Jupyter Notebook in VS Code, and it's a simple demo of how we can use Splinter and BeautifulSoup for web scraping, as part of our data analytics bootcamp. All I did was set up Splinter and I get both a SeleniumManagerException and a WebDriverException message. So now I have no way to use Selenium or to make any progress in learning how to do web scraping. I also downloaded ChromeDriver but I have no idea where to put it.

How can we reproduce the issue?

from splinter import Browser
from bs4 import BeautifulSoup

# Set up Splinter
browser = Browser('chrome')

Relevant log output

---------------------------------------------------------------------------
SeleniumManagerException                  Traceback (most recent call last)
~/opt/anaconda3/lib/python3.9/site-packages/selenium/webdriver/common/service.py in start(self)
     94                 try:
---> 95                     path = SeleniumManager().driver_location(browser)
     96                 except WebDriverException as new_err:

~/opt/anaconda3/lib/python3.9/site-packages/selenium/webdriver/common/selenium_manager.py in driver_location(self, browser)
     72 
---> 73         binary, flag, browser = str(self.get_binary()), "--browser", browser
     74         result = self.run((binary, flag, browser))

~/opt/anaconda3/lib/python3.9/site-packages/selenium/webdriver/common/selenium_manager.py in get_binary()
     54             tracker = "https://github.com/SeleniumHQ/selenium/issues"
---> 55             raise SeleniumManagerException(f"{path} is missing.  Please open an issue on {tracker}")
     56 

SeleniumManagerException: Message: /Users/neth/opt/anaconda3/lib/python3.9/site-packages/selenium/webdriver/common/macos/selenium-manager is missing.  Please open an issue on https://github.com/SeleniumHQ/selenium/issues

During handling of the above exception, another exception occurred:

WebDriverException                        Traceback (most recent call last)
/var/folders/mk/bhfym4gn0xnc981k93pfv7r80000gn/T/ipykernel_7401/4025534989.py in 
      1 # Set up Splinter
...
    210                     f"'{os.path.basename(self.path)}' executable needs to be in PATH. {self.start_error_message}"
    211                 )

WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://chromedriver.chromium.org/home

Operating System

macOS Ventura

Selenium version

Python 3.9.13

What are the browser(s) and version(s) where you see this issue?

Chrome 111, Firefox 110

What are the browser driver(s) and version(s) where you see this issue?

ChromeDriver 111.0.5563.64

Are you using Selenium Grid?

???

github-actions[bot] commented 1 year ago

@knnthchng, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

titusfortner commented 1 year ago

Duplicate of https://github.com/SeleniumHQ/selenium/issues/11234 — please use latest version of Selenium.

Selenium Manager code does not get used if drivers are found on the system; alternate ways of installing drivers can be found here - https://www.selenium.dev/documentation/webdriver/getting_started/install_drivers/

github-actions[bot] commented 10 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.