记-selenium与webdriver版本不符问题

安装selenium之后,引入webdriver

代码如下(代码没问题):

from selenium import webdriver

b = webdriver.Chrome()

b.get('https://www.baidu.com')

b.close()

运行结果如下:

unknown error: Runtime.executionContextCreated has invalid 'context'...

引起此bug的原因为:webdriver与浏览器的版本不符合的原因

解决办法为:下载对应的浏览器webdriver版本

对应版本见

https://blog.csdn.net/huilan_same/article/details/51896672

下载chromedriver链接:

http://chromedriver.storage.googleapis.com/index.html

geckodriver下载链接:

http://npm.taobao.org/mirrors/geckodriver/

posted @ 2020-03-23 17:06  leon-chan  阅读(735)  评论(0编辑  收藏  举报