python - raise WebDriverException("无法连接到服务 %s" % self.path)
问题描述
我正在尝试在 virtualenv 中通过 selenium 打开一个 google chorme。但它不起作用。
我试过把更具体的 chormedirver.exe 路径和
我试图将路径修复为 Chrome(excutable_path='./chromedriver.exe')
但他们都没有工作
请帮我
我在 WSL2 上使用 ubuntu
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Chrome("./chromedriver.exe")
driver.get("http://www.python.org")
这是我的错误
Traceback (most recent call last):
File "/mnt/c/Users/USER/코드/selenium/google.py", line 4, in <module>
driver = webdriver.Chrome("./chromedriver.exe")
File "/home/princezheda/.local/lib/python3.6/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in __init__
self.service.start()
File "/home/princezheda/.local/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 104, in start
raise WebDriverException("Can not connect to the Service %s" % self.path)
selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service ./chromedriver.exe
解决方案
推荐阅读
- java - Keycloak 登录表单使用两个后续的 http 和 https 请求进行身份验证
- excel - 是否可以在没有 VBA 的情况下在 excel 中连接长度未知的范围?
- python - 为什么这个输入要问 2 次?
- javascript - 如何删除/删除列表组中动态创建的列表项?
- r - 在循环中更改多个数据框的列名
- ajax - 如何使用 AJAX 重新加载与 Rails 控制器操作无关的页面部分
- javascript - 从 CSV 导入时,HTML 表的末尾总是多出一行
- yaml - 使用 pandoc 转换时如何在 YAML 标头中保留注释
- c++ - 使用带有重载构造函数的 unique_ptr
- python-3.x - 将 pyspark pandas_udf 与 AWS EMR 一起使用时出现“没有名为‘pandas’的模块”错误