随笔分类 - 043selenium
摘要:参考:https://blog.csdn.net/sinat_34209942/article/details/81235925?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-4.ed
阅读全文
posted @ 2020-10-20 13:31
Alice1005
摘要:无头模式 demo from selenium import webdriver from selenium.webdriver.chrome.options import Options # => 引入Chrome的配置 import time # 配置 ch_options = Options(
阅读全文
posted @ 2020-10-15 15:11
Alice1005
摘要:chrome cls.driver = selenium.webdriver.Chrome() 驱动获取位置:https://chromedriver.chromium.org/downloads 放到 python/script下面 Firefox cls.driver = selenium.we
阅读全文
posted @ 2020-09-11 13:08
Alice1005
摘要:<html> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <title>单选和复选</title> </head> <body> </form> <h4>单选:性别</h4> <form> <
阅读全文
posted @ 2020-09-10 16:57
Alice1005
摘要:无需代理 # 无代理情况 cls.driver = selenium.webdriver.Chrome() cls.driver.get("http://daido.sitetest1.com/") cls.driver.maximize_window() 需要代理,代理没有密码 # 有代理,代理无
阅读全文
posted @ 2020-09-10 10:23
Alice1005
摘要:概述 有些场景的自动化测试中,需要带验证码登录,如下图,这种情况就需要识别图片中的验证码信息,然后转成文字进行登录 常用的方法有 1 利用baidu提供的api方法 2 利用pytesseract+Tesseract-OCR图片文字识别 3 使用一些训练方法识别(暂时未研究) 1 利用baidu提供
阅读全文
posted @ 2020-09-10 10:19
Alice1005
摘要:源代码 <div class="container-fluid"> <div class="row"> <div class="footer-bottom"> </div> </div> <div class="row step1-box"> <form action="/Recommend/Cho
阅读全文
posted @ 2020-09-10 10:16
Alice1005
摘要:输入框类型 一般4种 input 短的,单行 textarea 多行 div式的editor框 也可能是更复杂的iframe的editor input类型赋值 elem_user = self.driver.find_element_by_xpath('//*[@id="username"]') e
阅读全文
posted @ 2020-09-10 10:14
Alice1005
摘要:显示等待 隐式等待 区别 隐式等待相当于在WebDriver级别的显式等待 因为隐式等待一旦找到就会返回结果,而返回结果到脚本,再接收到下一条操作刚才找到的元素的命令需要一段时间。这段时间可能页面已经因为加载后续内容而发生了变化,之前找到的元素也受到了影响,于是操作元素的命令就无法正常执行了。 因为
阅读全文
posted @ 2020-05-22 15:19
Alice1005

浙公网安备 33010602011771号