Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Mac) Chromedriver not found; expected path 'C:/ChromeDriver/chromedriver.exe' #32

Open
lyricnz opened this issue May 27, 2020 · 6 comments

Comments

@lyricnz
Copy link

lyricnz commented May 27, 2020

On a Mac, it's looking for windows path. Why not look in the path first?

@lyricnz
Copy link
Author

lyricnz commented May 27, 2020

This would be somewhat addressed in PR 20 #20 - but would probably be better to look in the path first.

@lyricnz lyricnz changed the title Chromedriver not found; expected path 'C:/ChromeDriver/chromedriver.exe' (Mac) Chromedriver not found; expected path 'C:/ChromeDriver/chromedriver.exe' May 27, 2020
@lyricnz
Copy link
Author

lyricnz commented May 27, 2020

Raised a PR with a more complete solution
#34

@nikhil-mongo
Copy link

change the OS type to Darwin and pass the path where chromedriver is located. MacOS is darwin and not Linux.

@nikhil-mongo
Copy link

@lyricnz

@lyricnz
Copy link
Author

lyricnz commented Jun 10, 2020

@nikhil-mongo the existing code doesn't handle Mac at all - it checks for Windows, then defaults to Linux. The PR linked above checks the PATH first, then adds support for Mac.

@adamwoolhether
Copy link

if platform.system() == 'Linux':
if os.path.exists("/usr/bin/chromedriver"):
browser = webdriver.Chrome(executable_path="/usr/bin/chromedriver",
options=chrome_options)
else:
print("Chromedriver not found; expected path '/usr/bin/chromedriver'")
exit(1)
elif platform.system() == 'Darwin':
if os.path.exists("/usr/local/bin/chromedriver"):
browser = webdriver.Chrome(executable_path="/usr/local/bin/chromedriver",
options=chrome_options)
else:
print("Chromedriver not found; expected path '/usr/local/bin/chromedriver'")
exit(1)
else:
if os.path.exists("C:/ChromeDriver/chromedriver.exe"):
browser = webdriver.Chrome(executable_path="C:/ChromeDriver/chromedriver.exe",
options=chrome_options)
else:
print("Chromedriver not found; expected path 'C:/ChromeDriver/chromedriver.exe'")
exit(1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants