红豆沙  

2025年5月7日

摘要: https://googlechromelabs.github.io/chrome-for-testing/ 国内镜像地址 https://registry.npmmirror.com/binary.html?path=chrome-for-testing/ 阅读全文
posted @ 2025-05-07 14:55 红豆沙 阅读(138) 评论(0) 推荐(0)

2024年12月9日

摘要: expected_conditions 类提供了多种预定义的条件,这些条件可以用于 WebDriverWait 来等待页面上的某些特定状态或元素的状态。以下是 ExpectedConditions 中一些最常用的方法: title_is(title) 和 title_contains(title) 阅读全文
posted @ 2024-12-09 15:13 红豆沙 阅读(83) 评论(0) 推荐(0)
 
摘要: 相对定位器允许你基于其他元素的位置来定位页面上的元素。这对于那些动态生成或者难以通过传统方式(如 ID、类名或 XPath)准确定位的元素非常有用。你可以使用相对位置(上方、下方、左边、右边)以及接近度(靠近)来描述目标元素的位置。 在 Selenium 4 中,相对定位器是通过 with_tag_ 阅读全文
posted @ 2024-12-09 14:31 红豆沙 阅读(53) 评论(0) 推荐(0)

2024年11月28日

摘要: webdriver_manager 自动下载Chrome驱动,生成driver实例 首先安装 webdriver-manager包 :pip install webdriver-manager 在selenium4中使用如下: from selenium import webdriverfrom w 阅读全文
posted @ 2024-11-28 14:47 红豆沙 阅读(1121) 评论(0) 推荐(0)

2024年11月6日

摘要: import pymysql connection = pymysql.connect( host='localhost', port=3306, database='your_database', user='your_user', password='your_password', charse 阅读全文
posted @ 2024-11-06 11:43 红豆沙 阅读(25) 评论(0) 推荐(0)
 
摘要: 1.列表推导式:生成新的列表 [expression for item in iterable] numbers = [1, 2, 3, 4, 5] squares = [x**2 for x in numbers] print(squares) # 输出: [1, 4, 9, 16, 25] 2. 阅读全文
posted @ 2024-11-06 10:36 红豆沙 阅读(45) 评论(0) 推荐(0)

2024年11月5日

摘要: from pymysql import * arr1 = [ ['a','aa','aaa'], ['b','bb','bbb'], ['c','cc','ccc'] ] # 创建connection连接 user一般为root connection = connect( host='localho 阅读全文
posted @ 2024-11-05 18:02 红豆沙 阅读(238) 评论(0) 推荐(0)
 
摘要: import pandas as pd import pymysql from datetime import datetime # 定义一个自增的全局变量 counter = 1 def increment(): global counter counter += 1 return counter 阅读全文
posted @ 2024-11-05 17:55 红豆沙 阅读(95) 评论(0) 推荐(0)

2023年12月16日

摘要: 本地 命令 作用 注意 git -v 查看 git 版本 git init 初始化 git 仓库 git add 文件标识 暂存某个文件 文件标识以终端为起始的相对路径 例:git add page/login/index.html git add . 暂存所有文件 git commit -m '说 阅读全文
posted @ 2023-12-16 19:45 红豆沙 阅读(43) 评论(0) 推荐(0)

2023年11月27日

摘要: (1) 通过谷歌应用商店安装 (国外网站) (2) 极简插件: 下载 → 开发者模式 → 拖拽安装 → 插件详情允许访问文件 https://chrome.zzzmh.cn/index 下载的文件,解压。 chrome浏览器,右上角点击-》更多工具=》扩展程序。打开开发者模式 将解压的文件拖到空白区 阅读全文
posted @ 2023-11-27 11:28 红豆沙 阅读(920) 评论(0) 推荐(0)