当前位置:网站首页>selenium,元素操作以及浏览器操作方法
selenium,元素操作以及浏览器操作方法
2022-07-02 10:18:00 【杂学者】
一、元素操作
点击操作:元素.click()
输入操作:元素.send_key()
清除操作:元素.clear()
例如:
二、浏览器操作
常用的方法:
maximize_window()----最大化浏览器
set_window_size(width,height)----设置浏览器窗口的大小,宽、高为像素点。
set_window_position(x,y)----设置浏览器窗口左上角点所在显示器的位置(像素点的位置)
back()----后退,相当于浏览器中的后退按钮
forward()----前进,相当于浏览器中的前进按钮
close()----关闭浏览器当前的标签页(不是关闭整个浏览器)
quit()----关闭整个浏览器
title----获取浏览器的title(浏览器标签页顶部显示的内容)
current----获取浏览器url地址
三、获取元素信息
常用的方法:
size----返回元素大小
text----返回元素的文本内容
get_attribute("abd")----获取属性值,abc为属性的名称
is_displayed()----判断元素是否可见
is_enabled()----判断元素是否可用
is_selected()----判断元素是否被选中,主要用在类似复选框、单选按钮上
边栏推荐
- Unity skframework framework (XX), VFX lab special effects library
- JS reverse massive creative signature
- When tidb meets Flink: tidb efficiently enters the lake "new play" | tilaker team interview
- Winter vacation daily question - lucky numbers in the matrix
- 题解:《你的飞碟在这儿》、《哥德巴赫猜想》
- 操作教程:EasyDSS如何将MP4点播文件转化成RTSP视频流?
- Runhe hi3516 development board openharmony small system and standard system burning
- JS逆向之巨量创意signature签名
- Chinese name extraction (toy code - accurate head is too small, right to play)
- Origin绘制热重TG和微分热重DTG曲线
猜你喜欢
OpenFOAM:lduMatrix&lduAddressing
Integral link, inertia link and proportion link in Simulink
Bridge of undirected graph
为什么switch 的default后面要跟break?
Chinese name extraction (toy code - accurate head is too small, right to play)
[cloud native database] what to do when encountering slow SQL (Part 1)?
Partner cloud form strong upgrade! Pro version, more extraordinary!
Professor of Shanghai Jiaotong University: he Yuanjun - bounding box (containment / bounding box)
Common options of tcpdump command: Three
Don't spend money, spend an hour to build your own blog website
随机推荐
Independent and controllable 3D cloud CAD: crowncad enables innovative design of enterprises
Numpy array calculation
Explanation of 34 common terms on the Internet
[youcans' image processing learning course] general contents
[true topic of the Blue Bridge Cup trials 43] scratch space flight children's programming explanation of the true topic of the Blue Bridge Cup trials
Daily question: 1175 Prime permutation
量子三体问题: Landau Fall
[technology development-22]: rapid overview of the application and development of network and communication technology-2-communication Technology
Why can't d link DLL
EasyDSS点播服务分享时间出错如何修改?
Unity skframework framework (XVII), freecameracontroller God view / free view camera control script
leetcode621. 任务调度器
JS reverse massive creative signature
2022 zero code / low code development white paper [produced by partner cloud] with download
Crowncad (crown CAD), the first fully independent 3D CAD platform based on Cloud Architecture in China
SSL证书的分类有哪些?如何选择合适的SSL证书?
We sincerely invite young creators to share with investors and entrepreneurs how to make choices in life in the metauniverse
mac(macos Monterey12.2 m1) 个人使用php开发
Embedded software development
三谈exception——错误处理