第五章 . Selenium Web 自动化模块 - 【元素的定位】class属性定位

通过class 属性定位元素 (class 可能不止一个) el3 = driver.find_element(By.CLASS_NAME, 's_ipt') from selenium.webdriver.chrome.service import Service from selenium im

第五章 . Selenium Web 自动化模块 - 【元素的定位】name属性定位

1.通过 name 属性定位元素 语法 driver.find_element(By.NAME, 'wd') from selenium.webdriver.chrome.service import Service from selenium import webdriver from selen

第五章 . Selenium Web 自动化模块 - 【元素的定位】id属性定位

1.通过 id 属性定位元素 语法: from selenium.webdriver.common.by import By driver.find_element(By.ID, 'value') 参数: 传入标签属性中id的值 返回值: 返回一个元素对象 代码示例: from selenium.w

第五章 . Selenium Web 自动化模块 - 【浏览器操作】模拟页面相关操作


1.打开请求地址 from selenium import webdriver from selenium.webdriver.chrome.service import Service import time #1.如何打开网址 driver = webdriver.Chrome(service=

Day16 - KMP 算法(理论篇)


文本串 aabaabaaf 模式串 aabaaf 问题:在文本串中aabaabaaf找到模式串aabaaf 的位置 理解暴力算法的痛点 如果使用暴力算法,模式串匹配失败时,会从头开始,文本串也会回退,效率大幅下降。 文本串 aabaabaaf 模式串 aabaaf 当b≠f的时候,匹配失败,文本串从

Day16 - 151.翻转字符串里的单词


题目链接:https://leetcode.cn/problems/reverse-words-in-a-string/description/ 核心方法:双指针 class Solution: def reverseWords(self, s: str) -> str: w

macOS 安装homebrew

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

第五章 . Selenium Web 自动化模块 - 【浏览器操作】模拟浏览器相关操作


1.如何创建浏览器对象 from selenium import webdriver from selenium.webdriver.chrome.service import Service #1.创建浏览器对象 driver = webdriver.Chrome(service=Servic

macOS 安装Chrome Driver

下载地址:https://googlechromelabs.github.io/chrome-for-testing/#stable 选择与本地谷歌浏览器对应的版本 移动到 /usr/local/bin/目录下(该目录默认隐藏,可以通过shift+command+g搜索进入)

第五章 . Selenium Web 自动化模块 - 介绍及环境安装


1.Selenium 模块介绍 浏览器操作模拟:如打开请求地址,浏览器最大化,关闭浏览器等操作 支持八种元素定位方式:id、name、class name、tagname、linktext、patial linktext、xpath、css selectol 支持各种对元素的操作:点击、输入、获取属