-1

I am using colab. I am trying to use selenium with python. I looked at different threads regarding adding the chromedriver to the PATH, which I did, but I keep getting the same error. I get two messages:

  1. FileNotFoundError: [Errno 2] No such file or directory: 'C:\bin\chromedriver.exe': 'C:\bin\chromedriver.exe'
  2. WebDriverException: Message: 'C:\bin\chromedriver.exe' executable needs to be in PATH

Here is my screenshot of error: code error

jaralepi
  • 3
  • 2

1 Answers1

0

You don't have the path set up properly. Lucky for you this is doable through code. I used to do this all the time to have a portable swing application that run selenium on a shared project that ran on every laptop without explaining this stuff to them

# assign ChromeDriver path to variable
chrome = "/Users/Administrator/Downloads/chromedriver"
os.environ["webdriver.chrome.driver"] = chrome

I used to do it in Java but it should be doable on every language https://www.approbotic.com/rpa/rpa/how-do-i-run-chrome-with-selenium-webdriver-in-python/#page-content

If you are using paths make sure that you are using the right arrows to indicate location \ isn't the same as \

How to get an absolute file path in Python

dot
  • 64
  • 7