RahulShaw / LinuxAcademy-DL

Download videos from your LinuxAcademy account for offline viewing
MIT License
65 stars 44 forks source link

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

Open lyricnz opened 4 years ago

lyricnz commented 4 years ago

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

lyricnz commented 4 years ago

This would be somewhat addressed in PR 20 https://github.com/RahulShaw/LinuxAcademy-DL/pull/20 - but would probably be better to look in the path first.

lyricnz commented 4 years ago

Raised a PR with a more complete solution https://github.com/RahulShaw/LinuxAcademy-DL/pull/34

nikhil-mongo commented 4 years ago

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

nikhil-mongo commented 4 years ago

@lyricnz

lyricnz commented 4 years ago

@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 commented 4 years ago

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)