摘要: 3种等待: 显示等待,WebDriverWait(driver,timeout=10).until(ec.presence_of_element_located(locator)),超时时间内定位到locator后执行下一步,否则超时异常 隐式等待,driver.implicitly_wait(ti 阅读全文
posted @ 2021-08-31 23:06 花兒向陽開 阅读(20) 评论(0) 推荐(0) 编辑
摘要: from selenium.webdriver import Chrome, ChromeOptions from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWa 阅读全文
posted @ 2021-08-31 22:49 花兒向陽開 阅读(105) 评论(0) 推荐(0) 编辑
摘要: def test(): options = ChromeOptions() options.add_argument('--headless') # 无界面 options.add_argument('--no-sandbox') # root权限 options.add_argument('--d 阅读全文
posted @ 2021-08-31 22:48 花兒向陽開 阅读(32) 评论(0) 推荐(0) 编辑
摘要: (ChromeDriver下载地址)[http://chromedriver.storage.googleapis.com/index.html] 浏览器驱动的下载地址百度就有 根据浏览器版本和系统下载对应的驱动 驱动所在目录需要设置环境变量,放在其他已设置环境变量的目录下亦可 阅读全文
posted @ 2021-08-31 21:45 花兒向陽開 阅读(59) 评论(0) 推荐(0) 编辑
摘要: function getHumpLineName (s) { return s.replace(/_(\w)/g, function (all, letter) { return letter.toUpperCase() }) } function getUnderLineName (s) { re 阅读全文
posted @ 2021-08-31 14:30 花兒向陽開 阅读(86) 评论(0) 推荐(0) 编辑
摘要: drf-serializer 序列化和反序列化 序列化过程:响应的python对象转化为响应报文的json字节流 反序列化过程:请求body的json字节流转化为python对象 序列化和反序列化处理过程 # POST def user(request): # 使用json工具进行请求数据反序列化 阅读全文
posted @ 2021-08-31 14:29 花兒向陽開 阅读(19) 评论(0) 推荐(0) 编辑