当前位置:网站首页>Seleniu:元素常用操作
Seleniu:元素常用操作
2022-08-01 04:59:00 【不怕猫的耗子A】
Selenium元素操作
1、在使用Selenium过程中,仅仅是对元素进行定位和对浏览器WebDriver对象进行操作是完全不够的,更多的是需要我们对一个元素进行操作
⑴比如:向输入框中输入数据、点击按钮等等
2、使用元素定位方法定位到一个元素后,find_element_by_*等方法会返回一个WebElement对象
⑴此时我们就能根据WebElement对象下的一些方法或属性对这个元素进行一定的操作
3、实际中我们是怎么使用一个网页的(怎么操作网页元素的),在Selenium中也应该怎么操作
⑴需要分清楚元素可能进行哪些操作,要找对操作的方法
WebElement对象常用方法和属性
1、在实际使用浏览器过程中我们经常用到的操作可能就是输入、点击操作了
2、因此这里先介绍下WebElement对象常用方法和属性
WebElement对象方法
输入框操作
1、在使用Web网页过程中,常常需要我们向一些输入框中输入一些数据,以便向服务器发送数据
2、Selenium中也提供了对应的接口,用来模拟向输入框中输入数据
⑴WebElement对象.send_keys(*value):模拟键盘向输入框中输入内容
①参数value:需要输入的字符串
⑵WebElement对象.clear()
边栏推荐
- Immutable
- 干货!如何使用仪表构造SRv6-TE性能测试环境
- typescript27 - what about enumeration types
- pytroch、tensorflow对比学习—功能组件(数据管道、回调函数、特征列处理)
- 冲刺金九银十,Android开发面试(内含面试资料|面试题|源码)
- 力扣(LeetCode)212. 单词搜索 II(2022.07.31)
- typescript20-接口
- Swastika line-by-line parsing and realization of the Transformer, and German translation practice (2)
- 程序员代码面试指南 CD15 生成窗口最大值数组
- (Codeforce 757)E. Bash Plays with Functions(积性函数)
猜你喜欢
7月编程排行榜来啦!这次有何新变化?
UE4 制作遇到的问题
typescript25 - type assertion
7 行代码搞崩溃 B 站,原因令人唏嘘!
(Codeforce 757)E. Bash Plays with Functions(积性函数)
Swastika line-by-line parsing and realization of the Transformer, and German translation practice (a)
怀念故乡的面条
(Codeforce 757) E. Bash Plays with Functions
FFmpeg 搭建本地屏幕录制环境
state compressed dp
随机推荐
UE4 rays flashed from mouse position detection
pytroch、tensorflow对比学习—专栏介绍
(Codeforce 757) E. Bash Plays with Functions
typescript26-字面量类型
state compressed dp
LeetCode 1189. “气球” 的最大数量
typescript25-类型断言
认真对待每一个时刻
Swastika line-by-line parsing and realization of the Transformer, and German translation practice (a)
Dry goods!How to Construct SRv6-TE Performance Test Environment Using Instrumentation
出现Command ‘vim‘ is available in the following places,vim: command not found等解决方法
pytroch、tensorflow对比学习—使用GPU训练模型
[target detection] YOLOv7 theoretical introduction + practical test
零序电流继电器器JL-8C-12-2-2
MySQL-DML语言-数据库操作语言-insert-update-delete-truncate
PAT乙级 1001 害死人不偿命的(3n+1)猜想
Excel record of integer programming optimization model to solve the problem
怀念故乡的面条
雪糕和轮胎
7 行代码搞崩溃 B 站,原因令人唏嘘!