cannot connect to chrome at 127.0.0.1:9222
2024-10-17 00:02:59
- window10系统,先cmd打开chrome,
chrome --remote-debugging-port=9222
- 执行脚本
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
def 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:9222
E from chrome not reachable
..\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py:242: WebDriverException
- 发现打开调试浏览器一段时间后,就会连不上,这是需要关闭浏览器,重新执行
chrome --remote-debugging-port=9222
- 再不行,重启电脑,问题解决
最新文章
- HTML+CSS中的一些小知识
- sql脚本多服务器操作
- NSoperation用法详解及与GCD的比较
- A+B问题 涉及EOF
- 菜鸟学习Hibernate——持久层框架
- python在linux制作图形界面(snack)
- SRM566 1000pts
- 利用java反射机制对方法进行调用
- 让rdlc报表在ReportViewer中水平居中的方法
- json中头疼的null
- nginx+lua安装配置
- 【NOIP2015】字串
- 【BZOJ1934】善意的投票(网络流)
- netty和protobuf的使用
- 基于ROS的分布式机器人远程控制平台
- 图灵机器人API接口
- 前端UI框架总结
- Spark多种运行模式
- 使用spring validation完成数据后端校验
- js 正则表达式验证密码、邮箱格式.....
热门文章
- MySQL05
- 【Azure 应用服务】App Service .NET Core项目在Program.cs中自定义添加的logger.LogInformation,部署到App Service上后日志不显示Log Stream中的问题
- NOIP 模拟 $32\; \rm Walker$
- NOIP 模拟 $12\; \text{简单的区间}$
- 题解 y
- 【开发工具】idea常用配置
- win10 安装mysql5.7 【自定义安装路径】
- (二)js基础。。。freecodecamp笔记
- 一、web请求
- 学习Java的9张思维导图