擅长:python、mysql、java
<p>请使用下面提到的代码行,而不是您正在使用的代码行:</p>
<pre><code>driver.execute_script("arguments[0].scrollIntoView();", element)
</code></pre>
<p><strong>更新答案:</strong><br/>
您也可以使用<code>location_once_scrolled_into_view</code>它提供元素的坐标,但它也会将元素滚动到视图中。你可以像这样使用它:</p>
^{pr2}$