使用chrome_driver自動化操作Google瀏覽器,調(diào)試的時候沒有提示,但是編譯后就提示一些錯誤的解決方法:
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證書驗(yàn)證
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']) # 防止打印一些無用的日志
可以兩個同時加上。文章來源:http://www.zghlxwxcb.cn/news/detail-765019.html
3、禁用“瀏覽器正在被自動化程序控制的提示”的方法如下:(有些教程只寫了第一行,實(shí)測不生效。)文章來源地址http://www.zghlxwxcb.cn/news/detail-765019.html
options.add_argument('--disable-infobars')
options.add_argument('--disable-extensions')
options.add_argument('--disable-popup-blocking')
到了這里,關(guān)于selenium 使用chrome_driver自動化操作Google瀏覽器,調(diào)試的時候沒有提示,但是編譯后就提示一些錯誤的解決方法的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!