Home > Blockchain >  Python - Webdriver Manager don't find Google Chrome?
Python - Webdriver Manager don't find Google Chrome?

Time:06-08

I am working on a little Web-Scraping project with Selenium. I had to replace driver = webdriver.Chrome(executable_path=chrome_driver_path) with driver = webdriver.Chrome(service=Service(ChromeDriverManager().install())) because executable_path was deprecated. Here is a short snippet of my code:

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
import time

#chrome_driver_path = "C:\chromedriver_win32/chromedriver.exe"
#driver = webdriver.Chrome(executable_path=chrome_driver_path)
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()))

And here's the problem, when I run the code that's the output I get:

[WDM] - ====== WebDriver manager ======
[WDM] - Could not get version for google-chrome. Is google-chrome installed?
[WDM] - Get LATEST chromedriver version for None google-chrome
[WDM] - Driver [C:\Users\User\.wdm\drivers\chromedriver\win32\102.0.5005.61\chromedriver.exe] found in cache

I installed the latest version of Selenium and the ChromeDriverManager, why can't it find Google Chrome? Thanks in advance!

CodePudding user response:

For everyone who has the same problem, the following line worked for me:

s=Service('C:\chromedriver_win32\chromedriver.exe')
driver = webdriver.Chrome(service=s)

CodePudding user response:

You can check your Chrome Version by opening the chrome browser > settings > About Chrome. Make sure that you are using the same selenium chrome version that is in your chrome browser. You can download the version from this website: https://chromedriver.chromium.org/downloads

  • Related