None

生命就像一条蜿蜒的河流

导航

2021年2月26日 #

selenium学习笔记13-解决验证码问题

摘要: 方案一:使用pytesseract和pillow实现验证码识别 可以使用pytesseract 模块和 PIL模块解决不太复杂的验证码问题,实现步骤如下: 1、安装pytesseract -》pip install pytesseract 2、安装PIL模块 -》pip install pil 仅可 阅读全文

posted @ 2021-02-26 15:46 我睡着了 阅读(235) 评论(0) 推荐(0) 编辑

selenium学习笔记12-实现屏幕截屏

摘要: from selenium import webdriver from time import sleep, strftime, localtime, time import os class TestCase(object): def __init__(self): self.driver = w 阅读全文

posted @ 2021-02-26 10:30 我睡着了 阅读(72) 评论(0) 推荐(0) 编辑

selenium学习笔记11-JavaScript操作滚动条

摘要: selenium执行JavaScript脚本 webdriver有两个方法来执行JavaScript,分别是: execute_script同步执行 execute_async_script异步执行 通过JavaScript通常可以实现页面滚动 代码如下: from selenium import 阅读全文

posted @ 2021-02-26 10:29 我睡着了 阅读(74) 评论(0) 推荐(0) 编辑

selenium学习笔记10-鼠标单击、双击、右击、键盘输入、键盘组合键的应用

摘要: 代码如下: from selenium import webdriver from time import sleep # http://sahitest.com/demo from selenium.webdriver import ActionChains from selenium.webdr 阅读全文

posted @ 2021-02-26 10:25 我睡着了 阅读(148) 评论(0) 推荐(0) 编辑

selenium学习笔记09-三种等待方式及17种等待条件

摘要: selenium三种等待方式 time.sleep(固定等待) 在开发自动化框架的过程中,最忌讳使用python自带模块time的sleep方式进行等待,虽然可以自定义等待时间,但当网络良好时,依旧按照预设定的时间继续等待,导致整个项目的自动化时间无限延长,不建议使用(注:脚本调试过程中,还是可以方 阅读全文

posted @ 2021-02-26 10:14 我睡着了 阅读(190) 评论(0) 推荐(0) 编辑

selenium学习笔记08-selenium处理弹窗

摘要: selenium处理弹窗 页面上的弹窗有三种: alert:用来提示 confirm:用来确认 prompt:输入内容 代码如下: from selenium import webdriver from time import sleep import os class TestCase(objec 阅读全文

posted @ 2021-02-26 09:54 我睡着了 阅读(135) 评论(0) 推荐(0) 编辑