【发布时间】:2021-01-26 15:15:55
【问题描述】:
我正在尝试编写代码列表来自动化我的日常文件下载过程。我为此使用 Python Selenium。但是,我无法找到其中一个点击。
HTMI 代码如下:
<div class="card dark-blue"> <h3 data-mh="title-research" style="height: 52px;">Rated Range Prices (LT)</h3> <h4 class="disp_date">26-Jan-2021 17:47:58</h4> <div class="divider"></div> <a href="javascript:seemore('F10002');" value="F10002" class="link">See More »</a> </div>
这是我的代码:
link = driver.find_element_by_xpath("//a[@href='javascript:seemore('F10002');']")
错误信息:
InvalidSelectorException: invalid selector: Unable to locate an element with the xpath expression //*[@href='javascript:seemore('F10002');'] because of the following error:
SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//*[@href='javascript:seemore('F10002');']' is not a valid XPath expression.
(Session info: chrome=88.0.4324.104)
有人可以请教我吗?非常感谢。
【问题讨论】:
标签: python selenium xpath css-selectors webdriverwait