码迷,mamicode.com
首页 > 其他好文 > 详细

Selenium学习

时间:2017-09-03 12:18:13      阅读:146      评论:0      收藏:0      [点我收藏+]

标签:htm   webdriver   exce   环境   python   添加   get   pytho   title   

1、Selenium安装

pip install selenium

 

2、测试selenium

python selenium

from selenium import webdriver

browser = webdriver.Chrome()

browser.get(‘http://www.baidu.com/‘)

报错:

WebDriverException: Message: ‘chromedriver‘ executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

解决:安装chromedrive

3、chromedriver下载

chromedriver 驱动下载链接:https://chromedriver.storage.googleapis.com/index.html

chromedriver与chrome的对应关系表

chromedriver版本支持的Chrome版本
v2.32 v59-61
v2.31 v58-60
v2.30 v58-60
v2.29 v56-58

4、chromedriver

C:\Program Files (x86)\Google\Chrome\Application

环境变量

pach:添加C:\Program Files (x86)\Google\Chrome\Application

更改环境变量需要重启电脑

Selenium学习

标签:htm   webdriver   exce   环境   python   添加   get   pytho   title   

原文地址:http://www.cnblogs.com/xiaomj/p/7468992.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!