简体   繁体   English

Selenium 或 Chromedriver 随机停止使用 Python

[英]Selenium or Chromedriver randomly stopped working with Python

I have a few scripts in Python that use selenium and chromedriver for web scraping.我在 Python 中有一些脚本,它们使用 selenium 和 chromedriver 进行网页抓取。 They have worked fine for months but as of last night (04/06/2017) they started giving errors when I try to do anything with chromedriver.他们已经工作了好几个月,但从昨晚(04/06/2017)开始,当我尝试使用 chromedriver 做任何事情时,他们开始出现错误。 For example, these two lines of code produce a not secure error inside the browser address bar.例如,这两行代码在浏览器地址栏中产生一个不安全的错误。

browser = webdriver.Chrome()
browser.set_window_position(-10000, 0)

My scripts were made using Python 3.5.我的脚本是使用 Python 3.5 制作的。 I installed Python 3.6 but I am still using idle from 3.5.我安装了 Python 3.6,但我仍在使用 3.5 的空闲。 I installed Python 3.6 about 2 weeks ago and didn't have any problems with my scripts working.我大约 2 周前安装了 Python 3.6,我的脚本工作没有任何问题。 Why did this randomly start happening, which one of the two is the problem, and how can I fix this?为什么会随机开始发生这种情况,两者中的哪一个是问题,我该如何解决?

After downloading the newest version of chromedriver.exe and replacing the old chromedriver my issue was resolved.下载最新版本的 chromedriver.exe 并替换旧的 chromedriver 后,我的问题得到了解决。 I still get a not secure error on the browser when it opens but my scripts continue to run now.打开浏览器时,我仍然在浏览器上遇到不安全错误,但我的脚本现在继续运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM