当前位置:   article > 正文

selenium 使用chrome_driver自动化操作Google浏览器,调试的时候没有提示,但是编译后就提示一些错误的解决方法_error:ssl_client_socket_impl.cc(975)] handshake fa

error:ssl_client_socket_impl.cc(975)] handshake failed; returned -1, ssl err

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

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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/293737
推荐阅读
相关标签
  

闽ICP备14008679号