美文网首页
Python+selenium环境搭建

Python+selenium环境搭建

作者: 木子木子飞 | 来源:发表于2017-08-10 10:02 被阅读0次

1.安装Python,并配置环境变量

image.png
2.安装Python的selenium库
Python -m pip install selenium
3.安装pycharm,个人比较习惯他的编辑页面,比较方便
4.下载各个浏览器的webdriver,放在python.exe同一个目录下,也就是PythonHome目录
32位的iedriverserver.exe在sendkeys方法比64位(那简直是慢的要命,一秒钟一个字)的快了很多,也不知道是为什么
from selenium import webdriver
web=webdriver.Ie('IEDriverServer32.exe')
web.get('www.aaa.com')
input=web.find_element(value='kw')
input.send_keys('hello')
search=web.find_element(value='su')
search.click()

相关文章

网友评论

      本文标题:Python+selenium环境搭建

      本文链接:https://www.haomeiwen.com/subject/vjncrxtx.html