擅长:python、mysql、java
<p><a href="https://stackoverflow.com/questions/54681172/what-is-the-difference-between-the-different-scroll-options/54689339#54689339">^{<cd1>}</a>是domapi的一部分,您需要在<em>WebElement</em>上运行它,而不是在WebElement</em>的<em>列表上运行。在</p>
<p>您需要将<code>find_element(s)</code>更改为<code>find_element</code>:</p>
<pre><code>element = driver.find_element_by_class_name('dg-button')
driver.execute_script("return arguments[0].scrollIntoView();", element)
</code></pre>