Error in opening chrome browser on unix using selenium webdriver_manager

2.8k views Asked by At
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager

driver = webdriver.Chrome(ChromeDriverManager().install())
driver.get("http://www.python.org")
driver.quit()

Error Received :

Traceback (most recent call last): File "chrome_code.py", line 2, in from webdriver_manager.chrome import ChromeDriverManager File "/home/akshat/Desktop/test/venv/lib/python3.5/site-packages/webdriver_manager/chrome.py", line 4, in from webdriver_manager.driver import ChromeDriver File "/home/akshat/Desktop/test/venv/lib/python3.5/site-packages/webdriver_manager/driver.py", line 77 self.auth_header = {'Authorization': f'token {self._os_token}'} ^ SyntaxError: invalid syntax

1

There are 1 answers

0
densz On

This error occurs due to your python version is 3.5 whereas webdriver_manager is announced to work since version 3.6 as stated at https://pypi.org/project/webdriver-manager/.

Also python's "f'string'"-formatting is introduced in Python 3.6.

So, in order to solve the error with invalid syntax you could switch to the newer Python's version.