罗杰的博客
首页
Openclaw
算法训练营
Python全栈自动化
Linux
工具教程
1
什么是用户态和内核态
2
第六章 . requests 模块 - 【接口响应】解析text/html 响应
3
第六章 . requests 模块 - 【接口请求】requests模拟headers 传参
4
第二章 . Python基础 - Python数据类型概述
5
PO设计模式、数据驱动 - yaml 数据驱动实践
登录
罗杰
累计撰写
164
篇文章
累计创建
29
个分类
累计创建
11
个标签
导航
首页
Openclaw
算法训练营
Python全栈自动化
Linux
工具教程
目录
分类
Python全栈自动化
第五章 . Selenium Web 自动化模块 - 【下拉框操作】模拟操作下拉框
2025-07-28 21:09
3
0
24.3℃
Python全栈自动化
地址示例:https://sahitest.com/demo/selectTest.htm 1.确认选择 #1.按索引值选择下拉项 el1 = driver.find_element(By.ID,"s1Id") s = Select(el1) #实例化一个select对象 s.select_by_i
第五章 . Selenium Web 自动化模块 - 【弹出框操作】模拟操作系统弹窗
2025-07-27 18:47
2
0
24.2℃
Python全栈自动化
1.Alert 类型弹窗 driver.find_element(By.XPATH,".//button[@id='b1']").click() time.sleep(1) alert = driver.switch_to.alert #获取弹窗对象 a = alert.text print(a)
第五章 . Selenium Web 自动化模块 - 【鼠标和键盘操作】模拟键盘操作页面元素
1.输入文本 示例地址:https://www.baidu.com/ 示例: el1 = driver.find_element(By.XPATH,".//input[@class='s_ipt']") ActionChains(driver).send_keys('python').perform
2025-07-27 18:17
5
0
24.5℃
Python全栈自动化
第五章 . Selenium Web 自动化模块 - 【鼠标和键盘操作】模拟鼠标操作页面元素
1.鼠标点击 示例地址:https://sahitest.com/demo/clicks.htm 示例法: from selenium.webdriver.chrome.service import Service from selenium import webdriver from seleni
2025-07-27 17:53
3
0
24.3℃
Python全栈自动化
第五章 . Selenium Web 自动化模块 - 【元素操作】模拟操作页面元素
1.按钮点击操作 语法: el1 = driver.find_element(By.XPATH,".//div[@id='s-top-left']/a[1]") el1.click() 2.文本框操作 语法: # 文本框输入 el2 = driver.find_element(By.XPATH,".
2025-07-27 17:08
3
0
24.3℃
Python全栈自动化
第五章 . Selenium Web 自动化模块 - 【元素的定位】xpath 表达式定位
XPath 使用路径表达式在XML 文档中选取节点。节点通过沿着路径或者step 来选取 1.xpath 结合属性定位 语法: driver.find_element(By.XPATH,".//input[@id='kw]"
2025-07-27 16:49
2
0
24.2℃
Python全栈自动化
第五章 . Selenium Web 自动化模块 - 【元素的定位】css 选择器定位
1.css 结合基本属性定位(id,class,标签) 语法 driver.find_element(By.CSS_SELECTOR, '#id值') #css+id定位 driver.find_element(By.CSS_SELECTOR,'.class值') #css+class定位 driv
2025-07-27 12:38
6
0
24.6℃
Python全栈自动化
第五章 . Selenium Web 自动化模块 - 【元素的定位】部分链接文本定位
1.通过部分链接文本定位 from selenium.webdriver.chrome.service import Service from selenium import webdriver from selenium.webdriver.common.by import By import t
2025-07-27 11:14
5
0
24.5℃
Python全栈自动化
第五章 . Selenium Web 自动化模块 - 【元素的定位】链接文本定位
1.通过链接文本定位(对应文本必须要有链接) from selenium.webdriver.chrome.service import Service from selenium import webdriver from selenium.webdriver.common.by import B
2025-07-27 11:09
3
0
24.3℃
Python全栈自动化
第五章 . Selenium Web 自动化模块 - 【元素的定位】标签名定位
1.通过标签名定位(必须保证标签名唯一) el4 = driver.find_element(By.TAG_NAME, ' ') 由于百度输入框的标签名input 不止一个,所以可以定位到该输入框的form表单(唯一)
2025-07-27 11:02
2
0
24.2℃
Python全栈自动化
上一页
下一页
1
…
4
5
6
7
8
…
11
弹