擅长:python、mysql、java
<p>与常见的XML/HTML解析器不同,selenium模拟浏览器行为,因此它应该不会对JQuery生成的元素产生问题,正如您所担心的那样。选择器的问题是,<code>a</code>是类为^{<cd2>的元素的<em>not attribute</em>,而是<code>next</code>的<em>子级</em>。因此,您可以在此处为子项<code>></code>使用CSS选择器:</p>
<pre><code>link = driver.find_element_by_css_selector('.next > a')
link.click()
</code></pre>