【发布时间】:2021-12-27 23:16:21
【问题描述】:
我知道有几个 selenium 选项选择的例子。尽管如此,我仍然无法选择一个特定的网站。 https://www.gks.ru/dbscripts/munst/munst20/DBInet.cgi 我想在左上角选择 Excel 选项。 HTML 是 n 个附件
我试过这样靠近酒吧
for option in el.find_elements(By.TAG_NAME,'option'):
print(option.text)
if option.text == 'CSV':
option.click() # select() in earlier versions of webdriver
break
我还使用了 find_elements by class 和 css_selector
然后我用了
select = Select(driver.find_element(By.TAG_NAME,'Select'))
select.select_by_visible_text('Excel')
它也找不到元素
有人可以帮忙吗?
【问题讨论】:
标签: python selenium html-select webdriverwait select-options