所以我试图找到我在chrome上使用inspect元素找到的<ul>
标记:
<ul class = "jobs-search-results__list artdeco-list" itemtype="http://schema.org/ItemList"></ul>
这是我在Python中尝试的:
ul = driver.find_element_by_class_name("jobs-search-results__list artdeco-list")
它应该返回<ul>
标记。
相反,我得到了这个错误:
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element:{"method":"class","selector":"jobs-search-results__list artdeco-list"}
无论使用tag/xpath/absolutepath选择器,都会出现相同的错误。你知道吗
然后我发现这个元素不在HTML页面源代码中,所以selenium找不到它。 HTML Source (pastebin)
如果这个元素不在页面源代码中,我该如何查找它?你知道吗
您试图获取的
ul
元素的class
在使用Selenium
访问站点时正在更改。为此,请使用xpath作为现在可以找到
ul
元素相关问题 更多 >
编程相关推荐