首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >json.decoder.JSONDecodeError in ChromeDriverManager().install()

json.decoder.JSONDecodeError in ChromeDriverManager().install()
EN

Stack Overflow用户
提问于 2022-09-16 19:51:17
回答 1查看 49关注 0票数 0

直到昨晚,当最后一次安装被尝试时,代码运行良好,我没有做任何更改。然后,当我再次运行我的程序时,我从终端得到了这个回溯:

代码语言:javascript
复制
<snip>
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)

我重建了整个虚拟环境,但仍然得到了这个错误。是什么引起的,我该怎么解决呢?

EN

回答 1

Stack Overflow用户

发布于 2022-09-16 20:39:36

在出现更好的答案之前,我只是没有在Chrome()对象中包含Chrome()参数,并注释掉了创建Service()对象的代码行,并且“修复”了它。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73749727

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档