快上网专注成都网站设计 成都网站制作 成都网站建设
成都网站建设公司服务热线:028-86922220

网站建设知识

十年网站开发经验 + 多家企业客户 + 靠谱的建站团队

量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决

pythonseleniumwebdriver启动chrome浏览器的方法

不废话,直接进入主题,本次演示如何启动chrome,且指定默认的profile

成都创新互联公司是一家专业提供红塔企业网站建设,专注与成都网站建设、做网站、html5、小程序制作等业务。10年已为红塔众多企业、政府机构等服务。创新互联专业网站设计公司优惠进行中。

下载chromedriver


地址:http://chromedriver.storage.googleapis.com/index.html?path=2.33/

特别注意:看notes.txt注意版本号一定要匹配啊,如果chromedriver版本和你的chrome版本不匹配那就可能启动不了!!!!!

实战代码


from selenium import webdriver

path="chromedriver.exe所在的完整路径"
option=webdriver.ChromeOptions()

#用chrome地址栏输入chrome://version/,查看自己的【个人资料路径】
option.add_argument('--user-data-dir=上面查看的个人资料路径写这里')
driver=webdriver.Chrome(executable_path=path,chrome_options=option)

#return driver

网站标题:pythonseleniumwebdriver启动chrome浏览器的方法
文章网址:http://6mz.cn/article/podhdp.html

其他资讯