ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
[TOC] ## 概述 Select类来处理下拉框 ``` from selenium.webdriver.support.select import Select ... se = driver.find_element_by_css_selector("#user_sex") Select(se).select_by_visible_text("男") sleep(1) Select(se).select_by_index(2) sleep(1) Select(se).select_by_value("1") # value 值是字符串, 整数会报错 ```