【发布时间】:2021-03-28 06:01:10
【问题描述】:
我在使用 python 选择 selenium 选项时遇到问题 所以我需要选择示例小说,而不是选择 General 或 General 以及 Action&Adventure 和 General ......就像在图像中一样,我尝试使用此代码进行操作,但它不起作用
el = driver.find_element_by_id('icon-fiction')
for option in el.find_elements_by_tag_name('General'):
if option.text == 'General':
option.click() # select() in earlier versions of webdriver
break
【问题讨论】:
-
请添加一般的html,屏幕截图没有提供相关信息
-
谢谢你记住我提到的网站
标签: python python-3.x selenium selenium-webdriver automation