摘要: [https://www.selenium.dev/documentation/webdriver/waits/](https://www.selenium.dev/documentation/webdriver/waits/) 有时候我们需要等待网页上的元素出现后才能操作。selenium中可以使 阅读全文
posted @ 2023-07-17 11:28 蕝戀 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 无头模式适合的场景: - 部署到没有gui界面的服务器,比如linux - 开发环境测试完全没问题后可以使用无头模式,提高selenium速度。 ```YAML # 使用headless无界面浏览器模式 chrome_options.add_argument('--headless') chrome 阅读全文
posted @ 2023-07-17 11:28 蕝戀 阅读(223) 评论(1) 推荐(0) 编辑
摘要: 这玩意一般般、OCR可以试试EasyOcr、飞桨OCR、 ```Python """ Tesseract 就是谷歌开源的一个OCR光学文字识别引擎 默认已经有训练好的库了,但它还可以加载别人训练好的库。 使用: 1、根据平台安装引擎 这里有一个【曼海姆大学图书馆】的封装版本 https://gith 阅读全文
posted @ 2023-07-17 11:27 蕝戀 阅读(22) 评论(0) 推荐(0) 编辑
摘要: ```Python import random import time from selenium import webdriver from selenium.webdriver import ActionChains from selenium.webdriver.chrome.service 阅读全文
posted @ 2023-07-17 11:27 蕝戀 阅读(46) 评论(0) 推荐(0) 编辑
摘要: [https://www.selenium.dev/documentation/webdriver/actions_api/](https://www.selenium.dev/documentation/webdriver/actions_api/) 注意:对于滚轮的操作,只支持chrome浏览器 阅读全文
posted @ 2023-07-17 11:26 蕝戀 阅读(40) 评论(0) 推荐(0) 编辑
摘要: [https://www.selenium.dev/documentation/webdriver/elements/file_upload/](https://www.selenium.dev/documentation/webdriver/elements/file_upload/) 用的方法就 阅读全文
posted @ 2023-07-17 11:26 蕝戀 阅读(6) 评论(0) 推荐(0) 编辑
摘要: # 查找元素 官方文档:[https://www.selenium.dev/documentation/webdriver/elements/locators/](https://www.selenium.dev/documentation/webdriver/elements/locators/) 阅读全文
posted @ 2023-07-17 11:24 蕝戀 阅读(274) 评论(0) 推荐(0) 编辑
摘要: # 浏览器属性 > 在使用selenium过程中,实例化driver对象后,driver对象有一些常用的属性和方法 1. `driver.page_source` 当前标签页浏览器渲染之后的网页源代码。 2. `driver.current_url` 当前标签页的url。 3. `dirver.ti 阅读全文
posted @ 2023-07-17 11:24 蕝戀 阅读(25) 评论(0) 推荐(0) 编辑
摘要: ```Python import time from selenium import webdriver from selenium.webdriver.chrome.service import Service as ChromeService # 驱动文件所在路径 DIRVER_PATH = r 阅读全文
posted @ 2023-07-17 11:15 蕝戀 阅读(264) 评论(0) 推荐(0) 编辑
摘要: ```Python import os import random import re import sys import time import urllib.parse import requests from lxml import etree from lxml.etree import _ 阅读全文
posted @ 2023-07-17 11:11 蕝戀 阅读(10) 评论(0) 推荐(0) 编辑