5
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 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.