硒 - 下拉菜单
我正在尝试刮擦本网站上生成的电子表格: htttps:httpps://sisaps.saude.saude.saude。 gov.br/sisvan/relatoriopublico/index
首先,您需要在顶部单击“ estado nutricional -selecionarrelatório”此下拉菜单的ID。我已经尝试过:
driver.find_element(by.id,'nuano')。select_by_value('2009'),
但我会遇到此错误:
'webelement'对象没有属性'select_by_value'。
如何找到它? 谢谢!
I'm trying to scrape spreadsheets generated in this website: https://sisaps.saude.gov.br/sisvan/relatoriopublico/index
First you need to click on "Estado nutricional -> Selecionar relatório" on the top, then select a year at "Ano de Referência:", but I can't find an ID for this dropdown menu. I have tried this:
driver.find_element(By.ID, 'nuAno').select_by_value('2009')
But I get this error:
'WebElement' object has no attribute 'select_by_value'.
How to find it?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
确保元素已找到:
另外,请确保您使用的是:
Make sure the element is located:
Also make sure you are using Select:
我使用
”葡萄牙语版本:
使用 seleniumbase 您可以使用
pytest
。添加- demo
选项以减慢测试,以便您看到发生的事情。 (全面披露:我构建了Seleniumbase框架。)I used the SeleniumBase Recorder to generate the script:
There's also the Portuguese version:
With SeleniumBase installed, you can run the scripts with
pytest
. Add the--demo
option to slow down the tests so that you can see what's happening. (Full disclosure: I built the SeleniumBase framework.)