win7下安装chromedriver和selenium测试

win7安装chromedriver 一.安装指定版本的Chrome 如下要求chromedriver与chrome的对应关系表chromedriver版本 支持的Chrome版本v2.29 v56-5

win7安装chromedriver

一.安装指定版本的Chrome

如下要求
chromedriver与chrome的对应关系表
chromedriver版本 支持的Chrome版本
v2.29 v56-58
v2.28 v55-57
v2.27 v54-56
v2.26 v53-55
v2.25 v53-55

详细见网址:http://blog.csdn/huilan_same/article/details/51896672

二.安装chromedriver

下载地址:http://npm.taobao/mirrors/chromedriver/
解压到指定目录:
例如:C:\Python\Python35\Scripts

三.测试代码

from selenium import webdriver
from selenium.webdrivermon.by import By
from selenium.webdrivermon.keys import Keys
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait


brower = webdriver.Chrome()

try:
    brower.get('http://www.iqiyi')

    widget_playcount = brower.find_element_by_id("widget-playcount")
    print(widget_playcount.text)
    print(brower.current_url)

finally:
    brower.close()

OK完成

发布者:admin,转转请注明出处:http://www.yc00.com/web/1737862785a3989671.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信