摘要: python+selenium十三:破解简单的图形验证码 此方法可破解简单的验证码,如: 注:中文识别正在寻找办法 安装: 1、python3 2、Pillow 3、pytesseract 4、tesseract-ocr 下载地址:https://pan.baidu.com/s/1kXIsg1S9C 阅读全文
posted @ 2018-11-21 23:40 怪圣卡杰 阅读(607) 评论(0) 推荐(0) 编辑
摘要: python+selenium十二:一个输入框双层input标签 先点击第一个,再对第二个进行操作,否则操作失败 driver.find_element_by_css_selector(".pwd").click()driver.find_element_by_css_selector(".pass 阅读全文
posted @ 2018-11-21 23:38 怪圣卡杰 阅读(339) 评论(0) 推荐(0) 编辑
摘要: python+selenium十:基于原生selenium的二次封装 from selenium import webdriverfrom selenium.webdriver.support.wait import WebDriverWaitfrom selenium.webdriver.supp 阅读全文
posted @ 2018-11-21 23:37 怪圣卡杰 阅读(1991) 评论(0) 推荐(0) 编辑
摘要: python+selenium十一:jQuery和js语法、js处理iframe selenium 执行jQuery/js语法 driver.execute_script(jQuery/js) 1、jQuery jQuery只支持css语法: jquery = '$(CSS).val("XXX"); 阅读全文
posted @ 2018-11-21 23:36 怪圣卡杰 阅读(351) 评论(0) 推荐(0) 编辑
摘要: python+selenium八:Alert弹窗 # 此弹窗是浏览器自带的弹窗,不是html中的元素 from selenium import webdriverfrom selenium.webdriver.common.action_chains import ActionChainsimpor 阅读全文
posted @ 2018-11-21 23:35 怪圣卡杰 阅读(254) 评论(0) 推荐(0) 编辑
摘要: python+selenium九:ddt数据驱动 读取excel内容 import xlrdclass ExcelUtil(): def __init__(self, excelPath, sheetName): #def __init__(self, excelPath, sheetName): 阅读全文
posted @ 2018-11-21 23:35 怪圣卡杰 阅读(369) 评论(0) 推荐(0) 编辑
摘要: python+selenium六:隐式等待 # 隐式等待# 全局生效,只写一次即可(仅当前页面)# 若有页面切换,需sleep等待新页面出现后,再使用此方法# 如:在35秒内,等待操作完成,完成后,不再等待# driver.implicitly_wait(35)from selenium impor 阅读全文
posted @ 2018-11-21 23:34 怪圣卡杰 阅读(341) 评论(0) 推荐(0) 编辑
摘要: python+selenium七:下拉框、选项框、select用法 from selenium import webdriverfrom selenium.webdriver.common.action_chains import ActionChainsimport timedriver = we 阅读全文
posted @ 2018-11-21 23:34 怪圣卡杰 阅读(4437) 评论(0) 推荐(0) 编辑
摘要: python+selenium四:iframe查看、定位、切换 1.查看iframe 1.Top Window:可直接定位 2.iframe#i:说明此元素在iframe上 3.iframe显示为空:(id或name为空) 4.右边这个看到是空的(2层iframe) from selenium im 阅读全文
posted @ 2018-11-21 23:33 怪圣卡杰 阅读(791) 评论(0) 推荐(0) 编辑
摘要: python+selenium五:多窗口切换与获取句柄 from selenium import webdriverfrom selenium.webdriver.common.by import Byimport timedriver = webdriver.Firefox()driver.get 阅读全文
posted @ 2018-11-21 23:33 怪圣卡杰 阅读(487) 评论(0) 推荐(0) 编辑
摘要: python+selenium三:鼠标事件与键盘事件 # 1、鼠标事件:# 每个模拟事件后需加.perform() 才会执行# context_click() 右击# double_click() 双击# drag_and_drop(source, target) 拖动# move_to_eleme 阅读全文
posted @ 2018-11-21 23:32 怪圣卡杰 阅读(513) 评论(0) 推荐(0) 编辑
摘要: python+selenium二:定位方式 # 八种单数定位方式:elementfrom selenium import webdriverimport timedriver = webdriver.Firefox()time.sleep(2) # 等待2秒driver.get('https://w 阅读全文
posted @ 2018-11-21 23:31 怪圣卡杰 阅读(299) 评论(0) 推荐(0) 编辑
摘要: # 1.打开Firefox浏览器 from selenium import webdriverdriver = webdriver.Firefox()driver.get("https://www.baidu.com") # 2.打开Ie或Chrome浏览器-->先将驱动文件放到python根目录 阅读全文
posted @ 2018-11-21 23:30 怪圣卡杰 阅读(301) 评论(0) 推荐(0) 编辑