LinuxAcademy-DL icon indicating copy to clipboard operation
LinuxAcademy-DL copied to clipboard

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

Open lyricnz opened this issue 5 years ago • 6 comments

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

lyricnz avatar May 27 '20 00:05 lyricnz

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 avatar May 27 '20 00:05 lyricnz

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

lyricnz avatar May 27 '20 03:05 lyricnz

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

nikhil-mongo avatar Jun 10 '20 16:06 nikhil-mongo

@lyricnz

nikhil-mongo avatar Jun 10 '20 16:06 nikhil-mongo

@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.

lyricnz avatar Jun 10 '20 23:06 lyricnz

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)

adamwoolhether avatar Jun 24 '20 15:06 adamwoolhether