webdriver_manager
webdriver_manager copied to clipboard
JSONDecodeError in ChromeDriverManager().install()
cd_service_obj = Service(ChromeDriverManager().install())
File "C:\...\my_venv\lib\site-packages\webdriver_manager\chrome.py", line 39, in install
driver_path = self._get_driver_path(self.driver)
File "C:\...\my_venv\lib\site-packages\webdriver_manager\core\manager.py", line 26, in _get_driver_path
binary_path = self.driver_cache.find_driver(driver)
File "C:\...\my_venv\lib\site-packages\webdriver_manager\core\driver_cache.py", line 101,
in find_driver
metadata = self.get_metadata()
File "C:\...\my_venv\lib\site-packages\webdriver_manager\core\driver_cache.py", line 135,
in get_metadata
return json.load(outfile)
File "C:\Users\myself\AppData\Local\Programs\Python\Python310\lib\json\__init__.py", line 293, in load
return loads(fp.read(),
File "C:\Users\myself\AppData\Local\Programs\Python\Python310\lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Users\myself\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\myself\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
I chucked and rebuit my entire virtual environment, to no effect.
can you try:
from webdriver_manager.chrome import ChromeDriverManager
webdriver.Chrome(service=Service(ChromeDriverManager().install()))
can you try:
from webdriver_manager.chrome import ChromeDriverManager webdriver.Chrome(service=Service(ChromeDriverManager().install()))
I didn't mess up the install command. The traceback clearly shows one line below where my snippet begins that webdriver_manager\chrome.py
was accessed and started throwing its error there.
I got this problem too.
Please attach to issues
- full console log of webdriver-manager with enabled WDM_LOG
- code sample to reproduce
- browser versions installed
- OS version
Please attach to issues
- full console log of webdriver-manager with enabled WDM_LOG
- code sample to reproduce
- browser versions installed
- OS version
@hebozhe clarifications needed.
I got the root cause of your issue, @hebozhe
Somehow you got broken drivers.json
file on your environment. Most likely someone edited it manually.
Please clean all .wdm
folders and other places you could save webdrivers by webdriver-manager. And version 3.8.5+ please. 3.8.5 is latest stable for now.