小工具知识网

当前位置: 首页 > 行业知识 > selenium 使用chrome

行业知识

selenium 使用chrome

2026-11-08 16:14:43 来源:互联网转载

使���chrome_driver自动化操作Google浏览器,调试的时候没有提示,但是编译后就提示一些错误的解决方法:

()

1、提示 ERROR:ssl_client_socket_impl.cc(975)] handshake failed; returned -1, SSL error code 1, net_error -101:

添加:

()
options.add_argument('verify=False') # 跳过SSL证书验证

2、提示 USB: usb_device_win.cc:95 Failed to read descriptors from \?\usb#vid_0e8d&pid_201d#0123456789abcdef#{a5dcbf10-6530-11d2-901f-00c04fb951ed}.

添加:

options.add_experimental_option("excludeSwitches", ['enable-automation', 'enable-logging']) # 防止打印一些无用的日志

可以两个同时加上。

3、禁用“浏览器正在被自动化程序控制的提示”的方法如下:(有些教程只写了第一行,实测不生效。)

options.add_argument('--disable-infobars')options.add_argument('--disable-extensions')options.add_argument('--disable-popup-blocking')

上一篇:服务器都怎么维护系统?

下一篇:Mac OS最新下载攻略,轻松获取,一键安装!