【发布时间】:2021-02-19 18:43:31
【问题描述】:
我正在编写一个脚本来自动收集数据,但在单击链接时遇到了问题。该网站在登录后,但我成功导航。我在尝试导航到下载页面时遇到了问题。这是在 python 中使用 chrome webdriver。
我尝试过使用:
find_element_by_partial_link_text('stuff').click()
find_element_by_xpath('stuff').click()
#and a few others
当我尝试一些选择器语句时,我得到以下消息的迭代。
NoSuchElementException: Message: no such element: Unable to locate element: {"method":"partial link text","selector":"download"}
(Session info: chrome=88.0.4324.182)
我尝试使用的 HTML 源是:
<a routerlink="/download" title="Download" href="/itron-mvweb/download"><i class="fa fa-lg fa-fw fa-download"></i><span class="menu-item-parent">Download</span></a>
谢谢!
【问题讨论】:
-
什么样的问题?请参阅How to Ask。
-
@Seth 是的,对不起。现已更新。
-
似乎是由拼写错误引起的。
Download需要大写(由于区分大小写)。
标签: python selenium-webdriver xpath css-selectors webdriverwait