当前位置:网站首页>Selenium:下拉框操作
Selenium:下拉框操作
2022-08-01 04:59:00 【不怕猫的耗子A】
下拉框
1、在Web网页中经常会遇到下拉框(下拉列表):比如说分页、每页显示的条数、语言的切换等功能,很多时候经常都是以下拉框的形式展现
2、下拉列表是网页中一种最节省页面空间的选择方式,默认状态下只显示一个选项,只有单击下拉按钮后才能看到全部的选项进而进行选择
3、在实际Web网页开发中下拉框的实现方式有很多:
⑴<select>和<option>实现下拉框
⑵<ul>和<li>实现下拉框
⑶其他
4、对于不同方式实现的下拉框,在使用Selenium对元素进行操作时可能会有一些细微的差距
⑴所以在进行下拉框元素操作时最好分清楚其实现方式是什么
select下拉框
1、select下拉框感觉是HTML中标准的下拉框实现方式(不过不怎么常见)
2、在HTML中select下拉框是由<select>和<option>配合使用的。具体语法格式如下:
⑴<select>标签用来创建一个下拉列表
⑵<option>标签表示下拉列表中的每一项(条目)
⑶关于<select>和<option>的属性等这里就不介绍了
3、针对select下拉框Selenium提供了专门的接口函数来操作对应的元素:Select类
⑴from selenium.webdriver.support.select import Select
4、操作步骤:
⑴首先定位到select标签,然
边栏推荐
- C# | 使用Json序列化对象时忽略只读的属性
- 项目风险管理必备内容总结
- typescript23-元组
- II. Binary tree to Offer 68 - recent common ancestor
- The difference between scheduleWithFixedDelay and scheduleAtFixedRate
- Error: AttributeError: module 'matplotlib' has no attribute 'figure'
- typescript28 - value of enumeration type and data enumeration
- typescript28-枚举类型的值以及数据枚举
- PAT class B 1001 (3n+1) conjecture
- 移动应用恶意攻击激增500% 三六零天御为APP免费构建安全屏障
猜你喜欢

Progressive Reconstruction of Visual Structure for Image Inpainting 论文笔记

(2022牛客多校四)A-Task Computing (排序+动态规划)

(2022 Nioke Duo School IV) D-Jobs (Easy Version) (3D prefix or)
![[target detection] YOLOv7 theoretical introduction + practical test](/img/ff/a83acbf9dd5cc2f907f3538d287842.png)
[target detection] YOLOv7 theoretical introduction + practical test

typescript26 - literal types

typescript26-字面量类型

移动应用恶意攻击激增500% 三六零天御为APP免费构建安全屏障

零序电流继电器器JL-8C-12-2-2

Swastika line-by-line parsing and realization of the Transformer, and German translation practice (a)

typescript25 - type assertion
随机推荐
数组问题之《两数之和》以及《三数之和 》
万字逐行解析与实现Transformer,并进行德译英实战(二)
pytroch、tensorflow对比学习—功能组件(数据管道、回调函数、特征列处理)
The method of solving stored procedure table name passing through variable in mysql
Dry goods!How to Construct SRv6-TE Performance Test Environment Using Instrumentation
LeetCode 387. 字符串中的第一个唯一字符
初识shell脚本
怀念故乡的面条
typescript21-接口和类型别名的对比
(more than 2022 cattle school four) A - Task Computing + dynamic programming (sort)
The Flow Of Percona Toolkit pt-table-checksum
HJS-DE1/2时间继电器
MySQL-数据定义语言-DDLdatebase define language
高数 | 【重积分】线面积分880例题
7月编程排行榜来啦!这次有何新变化?
Code Interview Guide for Programmers CD15 Generating an Array of Windowed Maximums
typescript25 - type assertion
李迟2022年7月工作生活总结
冲刺金九银十,Android开发面试(内含面试资料|面试题|源码)
云服务器下载安装mongo数据库并远程连接详细图文版本(全)