0

I'm confused as to what is causing this error:

The chrome version is 100.0.4986 which is the latest

enter image description here

Python version is 3.9.1:

enter image description here

Chrome web driver version is 100.0:

enter image description here

Path and location of web driver:

enter image description here

Code below based :

from selenium import webdriver

driver = webdriver.Chrome(executable_path=r'C:\Users\sanas\OneDrive\CSIT 110 Python\chromedriver.exe')

driver.get("https://www.google.com")

Error:

https://i.stack.imgur.com/dnceF.png

NicoCaldo
  • 1,171
  • 13
  • 25
  • 1
    the OneDrive folder sometimes is tricky. Try to put the chromedriver.exe in Documents or C: – NicoCaldo Apr 27 '22 at 11:53
  • 1
    Does this answer your question? [Error message: "'chromedriver' executable needs to be available in the path"](https://stackoverflow.com/questions/29858752/error-message-chromedriver-executable-needs-to-be-available-in-the-path) – NicoCaldo Apr 27 '22 at 11:57

1 Answers1

0

Put your chromedriver.exe in C:\ folder and try this code. The commented line is not necessary for opening new browser it will be used for finding elements on the page.

from selenium import webdriver
# from selenium.webdriver.common.by import By 
from selenium.webdriver.chrome.service import Service
ser = Service('C:\\chromedriver.exe')
opt = webdriver.ChromeOptions()

web = webdriver.Chrome(service=ser, options=opt)
web.get('url link you want to open')
Andrej12
  • 30
  • 1
  • 5