0

So I have had this code for sometime that worked without an issue for what I can recall. However, it has recently been raising an issue when I run it. Here is the code

chrome_options = Options()
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')

driver = webdriver.Chrome(options=chrome_options)

here is the error

selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH.
Alex is funny
  • 165
  • 1
  • 9

1 Answers1

0

First, you need to install ChromeDriver if it's not installed. (https://chromedriver.chromium.org/downloads)

Then, you need to add it to the PATH environment variable and you're good to go!

  • I understand but that is something I am not trying to do. I want to be able to use this code without having to install and add a chromedriver to PATH. Like I said previously this code used to work but now it doesn't, was there a change in the package? – Alex is funny Aug 16 '22 at 17:49
  • I don't think that you can use it without installing chromedriver. But if you don't want to add it to the PATH then you can specify path for webdriver.Chrome(executable_path="/your/path/to/chromedriver"), see https://stackoverflow.com/a/42478941/14226346. – Mustafa Ozan Çetin Aug 17 '22 at 08:19