python+selenium中webdriver相关资源
2024-09-06 08:18:28
Chrome
chrome的webdriver : http://chromedriver.storage.googleapis.com/index.html
chrome的webdriver需要对应chrome版本下载, 不同版本之间可能会出现不兼容情况.
Firefox
Firefox的webdriver : https://github.com/mozilla/geckodriver/releases/
Firefox的webdriver下载最新的即可.
IE
IE的webdriver : http://selenium-release.storage.googleapis.com/index.html
IE的webdriver建议下载32位驱动,64位windows系统也可使用32位驱动. 不推荐64位驱动的原因在于, 已知bug中, 在对网页元素输入字符串时速度极慢,如用下列代码时, 第13行键入字符串时, fengh.ssc需要耗时10秒.
def login(name='fengh.ssc', password='bob0.0.8'):
'''登录fss系统'''
global gl_driver
gl_driver = webdriver.Firefox()
gl_driver.maximize_window()
gl_driver.get("http://fss.sinopec.com")
if "财务共享自助服务" in gl_driver.title:
system = gl_driver.find_element_by_id('systemId')
system.click()
system.send_keys(Keys.PAGE_UP, Keys.ENTER)
user = gl_driver.find_element_by_name("loginnamesrc")
user.clear()
user.send_keys(name, Keys.TAB, password, Keys.ENTER)
# password = gl_driver.find_element_by_name('passwordsrc')#passwordsrc命名重复,无法定位
else:
print("请检查网络是否正常")
最新文章
- sql查询
- LeetCode:Two Sum II
- Android深度探索--HAL与驱动开发----第八章读书笔记
- 【转】Backbone使用总结
- HTML标签小结
- loopback 02
- CodeIgniter类库之Benchmarking Class ,计算代码的执行时间
- Matlab使用难点记忆
- virtualization-vs-containerization
- rpm软件包类型
- Excel设置下拉选项的方法
- 一道看似简单的sql需求(转)
- Q:记学习枚举过程中的一个小问题
- java笔试要点(java多线程)
- pta
- JQ 向上查找指定 同辈元素 找到后返回
- Lodop在页面获取打印机列表 选择打印机预览
- JavaWeb工程 目录结构***
- 在Ubuntu16.04上使用Autofs
- 在 ASP.NET Web API 中,使用 命名空间(namespace) 来作为路由的参数