擅长:python、mysql、java
<p>一个基本的方法是使用<code>ActionChain drag_and_drop</code></p>
<pre><code>ActionChains(driver).drag_and_drop(app_square, empty_square).pause(5).perform()
</code></pre>
<p>阅读更多<a href="https://selenium-python.readthedocs.io/api.html#selenium.webdriver.common.action_chains.ActionChains.drag_and_drop" rel="nofollow noreferrer">here</a></p>
<pre><code>drag_and_drop(source, target)
Holds down the left mouse button on the source element,
then moves to the target element and releases the mouse button.
Args:
source: The element to mouse down.
target: The element to mouse up.
</code></pre>