我知道有几个硒选项选择的例子。尽管如此,我仍然无法选择一个特定的网站。 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
我还按类和 css_selector 使用了 find_elements
然后我用
select = Select(driver.find_element(By.TAG_NAME,'Select'))
select.select_by_visible_text('Excel')
它也找不到元素
有人可以帮忙吗?