cannot connect to chrome at 127.0.0.1:9222

网友投稿 1721 2022-09-12

cannot connect to chrome at 127.0.0.1:9222

cannot connect to chrome at 127.0.0.1:9222

window10系统,先cmd打开chrome,​​​chrome --remote-debugging-port=9222​​执行脚本

from selenium import webdriverfrom selenium.webdriver.chrome.options import Optionsfrom selenium.webdriver.common.by import Bydef test_adduser(): options=Options() options.add_experimental_option('debuggerAddress', '127.0.0.1:9222') driver=webdriver.Chrome(options=options) driver.implicitly_wait(5) driver.find_element(By.CSS_SELECTOR,'.js_service_list a:nth-child(1) .index_service_cnt_item_title').click()

报错

> raise exception_class(message, screen, stacktrace)E selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:9222E from chrome not reachable..\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py:242: WebDriverException

发现打开调试浏览器一段时间后,就会连不上,这是需要关闭浏览器,重新执行​​chrome --remote-debugging-port=9222​​再不行,重启电脑,问题解决

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:python基础-集合set及内置方法(python内置的集合set中元素顺序)
下一篇:笔记本电脑没有WiFi选项,3个小时,我试了以下N种方法,终于出现网络了!
相关文章

 发表评论

暂时没有评论,来抢沙发吧~