摘要: 1.获取标签页数 lables = test.window_handles print(lables) 2. 切换标签页 lables = test.window_handles test.switch_to.window(lables[2]) 3.警告框alert元素交互(页面弹出框) # 关闭弹 阅读全文
posted @ 2024-11-23 23:31 铿锵有力自信且坚定 阅读(89) 评论(0) 推荐(0)
摘要: 1. 元素定位 查看网页元素 右键-->检查 from selenium.webdriver.common.by import By # 元素定位包 # 使用 test.find_element(By.XXX) 1)定位元素ID--对应浏览器id # 定位一个元素 a = test.find_ele 阅读全文
posted @ 2024-11-23 16:44 铿锵有力自信且坚定 阅读(112) 评论(0) 推荐(0)
摘要: 1. 创建打开浏览器 from selenium import webdriver # 用于操作浏览器 from selenium.webdriver.chrome.options import Options # 用于设置谷歌浏览器 # 创建设置浏览器对象 chrome_set = Options 阅读全文
posted @ 2024-11-23 03:34 铿锵有力自信且坚定 阅读(83) 评论(0) 推荐(0)
摘要: 官方技术文档:https://www.selenium.dev/ 1.谷歌浏览器chrome下载安装 https://www.google.com/chrome 查看安装版本号:(需要安装对应浏览器驱动版本) :-->帮助-->关于 2.安装谷歌浏览器驱动chromedriver(可直接放入pyth 阅读全文
posted @ 2024-11-23 02:52 铿锵有力自信且坚定 阅读(44) 评论(0) 推荐(0)