首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >快速VPN连接时webdriver.chrome不工作

快速VPN连接时webdriver.chrome不工作
EN

Stack Overflow用户
提问于 2020-10-16 20:10:13
回答 2查看 1.5K关注 0票数 1

我面临以下问题-

环境 Chrome版本-版本86.0.4240.75 (正式构建)( 64位)铬驱动器- ChromeDriver 86.0.4240.22 (从https://chromedriver.chromium.org/downloads下载) python 3.6.6 32位selenium - 3.141.0 ExpressVPN连接的Windows10Pro 64位系统

代码语言:javascript
运行
复制
from selenium.webdriver.chrome.options import Options
from selenium import webdriver
driver = webdriver.Chrome(options=options, executable_path='D:/chromedriver_win32/chromedriver.exe')

执行输出

代码语言:javascript
运行
复制
    D:\Assignment>python add_to_cart_v3.py

DevTools listening on ws://127.0.0.1:59948/devtools/browser/b3bea32b-25a1-47ff-800c-162e0200566a
Traceback (most recent call last):
  File "add_to_cart_v3.py", line 67, in <module>
    driver = webdriver.Chrome(options=options, executable_path=r'D:/chromedriver_win32/chromedriver.exe')
  File "C:\Users\pc\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 81, in __init__
    desired_capabilities=desired_capabilities)
  File "C:\Users\pc\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "C:\Users\pc\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "C:\Users\pc\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Users\pc\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: chrome not reachable

当我断开Express VPN时,它可以正常工作。请分享您的意见,什么可能是问题在这里。

EN

Stack Overflow用户

发布于 2020-10-16 20:17:21

试试这个,我和冲浪鲨鱼有同样的问题,但是这个解决了。使用pip安装webdriver_manager。使用webdriver_manager,不需要下载chromedriver,它会自动检测到您的铬版本。

代码语言:javascript
运行
复制
from selenium.webdriver.chrome.options import Options
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
options = webdriver.ChromeOptions()
driver = webdriver.Chrome(ChromeDriverManager().install(),options=options)
票数 0
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64395784

复制
相关文章

相似问题

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