- 在写12306爬虫时,遇到选择座席信息时,需要遍历select下拉框获取其中的座席信息。
- 代码如下:
seat_types = self.driver.find_element_by_xpath('.//select[starts-with(@id,"seatType")]') seat_ptions_list = seat_types.find_elements_by_tag_name("option") for option
python 遍历select下拉框,获取option标签中value和text的值
最新推荐文章于 2023-01-10 09:44:26 发布