I'm trying to (as a little side project) create a terminal application for magister that allows one to login and check their schedule and whatnot, but when testing this pretty cool looking project I came across the problem that somehow the chrome binary could not be found even though it should. Here's the output: (Where it says BINARY: /home/sjoerd/MagisTerm/magister-api-python/app/chromedriver
its just something I quickly added for debugging. As you can see the path should be correct.)
sjoerd@penguin:~/MagisTerm/magister-api-python/app$ python3 server.py
* Serving Flask app "server" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
* Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger PIN: 108-624-079
serving user
BINARY: /home/sjoerd/MagisTerm/magister-api-python/app/chromedriver
127.0.0.1 - - [14/Jun/2021 11:03:28] "GET /api/auth?username=22572&[email protected]&school=CSGdeWillemvanOranje HTTP/1.1" 500 -
Traceback (most recent call last):
File "/home/sjoerd/.local/lib/python3.7/site-packages/flask/app.py", line 2464, in __call__
return self.wsgi_app(environ, start_response)
File "/home/sjoerd/.local/lib/python3.7/site-packages/flask/app.py", line 2450, in wsgi_app
response = self.handle_exception(e)
File "/home/sjoerd/.local/lib/python3.7/site-packages/flask/app.py", line 1867, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/sjoerd/.local/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/sjoerd/.local/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/sjoerd/.local/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/sjoerd/.local/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/sjoerd/.local/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/sjoerd/.local/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/sjoerd/.local/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/sjoerd/MagisTerm/magister-api-python/app/server.py", line 23, in auth
return jsonify(requests_magister.accesstoken(username, password, school))
File "/home/sjoerd/MagisTerm/magister-api-python/app/requests_magister.py", line 9, in accesstoken
accessToken = getApiToken(username, password, school)
File "/home/sjoerd/MagisTerm/magister-api-python/app/apitoken.py", line 37, in getApiToken
chrome_options=chrome_options, executable_path=chrome_driver)
File "/home/sjoerd/.local/lib/python3.7/site-packages/seleniumwire/webdriver/browser.py", line 86, in __init__
super().__init__(*args, **kwargs)
File "/home/sjoerd/.local/lib/python3.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 81, in __init__
desired_capabilities=desired_capabilities)
File "/home/sjoerd/.local/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "/home/sjoerd/.local/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/home/sjoerd/.local/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/home/sjoerd/.local/lib/python3.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary
127.0.0.1 - - [14/Jun/2021 11:03:28] "GET /api/auth?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 200 -
127.0.0.1 - - [14/Jun/2021 11:03:28] "GET /api/auth?__debugger__=yes&cmd=resource&f=jquery.js HTTP/1.1" 200 -
127.0.0.1 - - [14/Jun/2021 11:03:29] "GET /api/auth?__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1" 200 -
127.0.0.1 - - [14/Jun/2021 11:03:30] "GET /api/auth?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 200 -
127.0.0.1 - - [14/Jun/2021 11:03:30] "GET /api/auth?__debugger__=yes&cmd=resource&f=ubuntu.ttf HTTP/1.1" 200 -
127.0.0.1 - - [14/Jun/2021 11:03:30] "GET /api/auth?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 200 -
^Csjoerd@penguin:~/MagisTerm/magister-api-python/app$ ls /home/sjoerd/MagisTerm/magister-api-python/app/chromedriver
/home/sjoerd/MagisTerm/magister-api-python/app/chromedriver
I'd love to hear if you have any idea what goes wrong here.
PS: The chromedriver binary has executable permissions.