Selenium
文章平均质量分 56
weixin_34322964
这个作者很懒,什么都没留下…
展开
-
python+selenium踩过的坑
1.加载谷歌驱动出现的问题:必须填写谷歌驱动的绝对路径才能打开浏览器解决方法:将谷歌驱动放在python环境的根目录下,就可不用写路径直接调用2.创建浏览器对象的时候,提示无法加载出该模块出现问题原因:Chrome写成了chrome...原创 2021-11-24 10:43:36 · 506 阅读 · 0 评论 -
Selenium常用的方法
发起请求:driver.get(url) 获取请求网页的标题:driver.title() 获取某元素ID中的内容:find_element_by_id(‘id名称’) 获取某元素ID中的所有内容:find_elements_by_id(‘id名称’) 获取某xpath中的内容:find_element_by_xpath(xpath) 获取某xpath中的内容:find_elements_原创 2017-11-21 11:10:17 · 230 阅读 · 0 评论 -
selenium实现登录页面的自动化测试
# -*- coding:utf-8 -*-import sysreload(sys)sys.setdefaultencoding("utf-8")from selenium import webdriverimport unittestclass LoginTest(unittest.TestCase): def setUp(self): # 创建浏览器原创 2017-11-16 09:41:28 · 8773 阅读 · 0 评论 -
Selenium常用的方法总结
发起请求:driver.get(url)获取请求网页的标题:driver.title()获取某元素ID中的内容:find_element_by_id(‘id名称’)获取某元素ID中的所有内容:find_elements_by_id(‘id名称’)获取某xpath中的内容:find_element_by_xpath(xpath)获取某xpath中的内容:find_elements原创 2017-12-13 16:34:39 · 4485 阅读 · 0 评论