[英]"DevToolsActivePort file doesn't exist" with ChromiumEdge
I've seen a lot of iterations of this question, but every single one of them were using Chrome.我已经看到了这个问题的很多迭代,但他们每个人都在使用 Chrome。 I'm trying to use Selenium to automate for work, but when I try to run my code on my company computer it fails, even though it was working perfectly on my personal computer.我正在尝试使用 Selenium 自动化工作,但是当我尝试在我的公司计算机上运行我的代码时它失败了,即使它在我的个人计算机上运行良好。 I'm given the error "selenium.common.exceptions.WebDriverException: Message: DevToolsActivePort doesn't exist".我收到错误“selenium.common.exceptions.WebDriverException:消息:DevToolsActivePort 不存在”。 I think it might be due to the cloud system that my workplace uses, but I'm not sure what to do about it.我认为这可能是由于我的工作场所使用的云系统,但我不知道该怎么办。 I attempted fixes suggested to Chrome users, but I haven't been able to pass options to the Edge() initializer.我尝试了向 Chrome 用户建议的修复,但我无法将选项传递给 Edge() 初始化程序。
My code fails already at this point.我的代码此时已经失败了。
from selenium import webdriver
browser = webdriver.Edge()
Adding the argument "--remote-debug-port=xxxx" fixed the issue.添加参数“--remote-debug-port=xxxx”解决了这个问题。
I had some problems with edge-selenium-tools and selenium4, but after uninstalling the former I was able to add options to the Edge driver.我在使用 edge-selenium-tools 和 selenium4 时遇到了一些问题,但在卸载前者后,我能够向 Edge 驱动程序添加选项。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.