Skip to content

Commit

Permalink
fix chrome driver installer
Browse files Browse the repository at this point in the history
problem fix when users of windows have the chrome installation in Program Files (x86)
  • Loading branch information
alejanpa17 committed Oct 9, 2023
1 parent ab70e56 commit 9ba4b3b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.exe
*.pyc
*.txt
9 changes: 5 additions & 4 deletions modules/chrome_driver_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ def get_chrome_version():
process = Popen(["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome", "--version"], stdout=PIPE)
chrome_version = process.communicate()[0].decode("UTF-8").replace("Google Chrome", "").strip()
elif platform == "win":
chrome_version = match(r"\d{2,3}.0.\d{4}.\d{1,3}", ' '.join(listdir("C:/Program Files/Google/Chrome/Application")))
if chrome_version is not None:
chrome_version = chrome_version.group()
else:
try:
chrome_version = match(r"\d{2,3}.0.\d{4}.\d{1,3}", ' '.join(listdir("C:/Program Files/Google/Chrome/Application")))
if chrome_version is not None:
chrome_version = chrome_version.group()
except:
chrome_version = match(r"\d{2,3}.0.\d{4}.\d{1,3}", ' '.join(listdir("C:/Program Files (x86)/Google/Chrome/Application")))
if chrome_version is not None:
chrome_version = chrome_version.group()
Expand Down

0 comments on commit 9ba4b3b

Please sign in to comment.