0

Before you rate me, I must say that I read almost every answer on this site about who had my same problem, but i found no answer.

For example there the one who asked the question accepted the first answer, but copy-pasting the code in the answer the same error was raised.

An other example there where is linked this video, which doesn't explain much, but there no error is raised, instead of my code when I copied it from the video. (he doesn't write .exe, so probably an error would be found in his code too)

This one has exactly my same problem, so it would be perfect, but no answer was accepted.

Here's the last line of the error:

selenium.common.exceptions.WebDriverException: Message: 'chrome.exe %s' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

At the end of the exception message there's a link, which says they migrated to another site.

The error message here:

FileNotFoundError: [WinError 2] Impossibile trovare il file specificato

During handling of the above exception, another exception occurred:

#Something else beetwen

selenium.common.exceptions.WebDriverException: Message: 'chrome.exe %s' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

Here's the beginning of my code:

from selenium import webdriver

chrome_path = "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s"

driver = webdriver.Chrome(executable_path=chrome_path)

I'm sure the path is correct, 'cause I copy-pasted it from the chrome.exe properties.

I also tried it without %s, and it raises a different error:

selenium.common.exceptions.WebDriverException: Message: Service C:/Program Files (x86)/Google/Chrome/Application/chrome.exe unexpectedly exited. Status code was: 0

Can someone help explaining me what's wrong?

Thanks


EDIT

I searched with file explorer for "chromedriver", and nothing was found.

2 Answers 2

1

You can try as following

driver = webdriver.Chrome(executable_path=r'Path_to_chrome_Driver\\chromedriver.exe')

You are locating chrome browser exe location. Please download chrome driver for selenium Chromedriver. Then enter the chrome driver location.

Note: Make sure you have downloaded the correct chromedriver based on your chrome browser version.

Sign up to request clarification or add additional context in comments.

5 Comments

chrome_path = r"C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s" driver = webdriver.Chrome(executable_path = chrome_path) Isn't it the same thing?
No. You are using Chrome Browser exe file. Please download chrome driver for selenium. Put in a location. Then enter the location in executable_path=r'Path_to_chrome_Driver\\chromedriver.exe'
Ok, I found it, there's no Win 64x version, I'll download 32x one
You can download from here. chromedriver.chromium.org/downloads
THANKS A LOT it worked, I didn't know that chromedriver must be installed.
1

As I see your path is to Chrome (browser) exe file instead of chromedriver.exe used by Selenium

4 Comments

C:/Program Files (x86)/Google/Chrome/Application/chrome.exe C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s C:/Program Files (x86)/Google/Chrome/Application/chromedriver.exe C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s /Program Files (x86)/Google/Chrome/Application/chrome.exe /Program Files (x86)/Google/Chrome/Application/chrome.exe %s All this possibilities don't work
Do you have the chromedriver.exe file there?
i only have the chrome.exe file there... there's no file called chromedriver on my pc, and it's strange because I used chrome as main browser for months...
chrome.exe is BROWSER file. Selenium is not a bowser. You need chromedriver.exe to work with Selenium with chrome browser

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.