python - selenium环境搭建的问题
阿神
阿神 2017-04-18 09:42:03
0
2
480
#-*- coding: UTF-8 -*-
from selenium import webdriver
import time


browser = webdriver.Chrome()
browser.get("http://cnblogs.com")
time.sleep(1)
browser.find_element_by_link_text("登录").click()
time.sleep(1)
browser.find_element_by_id("input1").send_keys("用户名")
browser.find_element_by_id("input2").send_keys("密码")
browser.find_element_by_id("signin").click()
time.sleep(1)
try:
    if browser.find_element_by_link_text("退出"):
        print "Login Successfully."
except:
    print "Login failed."

出现如上错误

已经使用sudo easy_install selenium安装了selenium

请问:

每一个接口调用的包,比如这里调用的是 chromedriver的包,是否每次都需要单独下载?
或者是有一次性安装包?
阿神
阿神

闭关修行中......

reply all(2)
小葫芦

Using selenium to operate chrome requires a driver. I have introduced it in my blog for your reference
Python installation guide for selenium

Peter_Zhu

you should put the chromedriver.exe path in the system environment varible PATH, or use the path to initiate selenium driver in your py.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!