yeongbin-jo / python-chromedriver-autoinstaller

The chromedriver auto installer for distribution.
MIT License
237 stars 77 forks source link

FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Program Files\\Google\\Chrome\\Application #71

Closed shaiksamad closed 9 months ago

shaiksamad commented 10 months ago

code:


from selenium import webdriver
import chromedriver_autoinstaller

chromedriver_autoinstaller.install()  # Check if the current version of chromedriver exists
                                      # and if it doesn't exist, download it automatically,
                                      # then add chromedriver to path

driver = webdriver.Chrome()
driver.get("http://www.python.org")
assert "Python" in driver.title
driver.quit()

Error:

Traceback (most recent call last): File "C:\Users\samad\Desktop\project\main.py", line 5, in chromedriver_autoinstaller.install() # Check if the current version of chromedriver exists File "C:\Users\samad\Desktop\project\venv\lib\site-packages\chromedriver_autoinstaller__init__.py", line 21, in install
chromedriver_filepath = utils.download_chromedriver(path, no_ssl) File "C:\Users\samad\Desktop\project\venv\lib\site-packages\chromedriver_autoinstaller\utils.py", line 269, in download_chromedriver chrome_version = get_chrome_version() File "C:\Users\samad\Desktop\project\venv\lib\site-packages\chromedriver_autoinstaller\utils.py", line 166, in get_chrome_version dirs = [f.name for f in os.scandir("C:\Program Files\Google\Chrome\Application") if f.is_dir() and re.match("^[0-9.]+$", f.name)] FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\Program Files\Google\Chrome\Application'

shaiksamad commented 10 months ago

I can solve this.

shaiksamad commented 10 months ago

Fixed in PR #72