![](/img/trans.png)
[英]In Selenium with python ,how to move mouse pointer (using pyautogui) to click on an element whose xpath is known?
[英]Python Selenium iFrame - how to move mouse and click?
Python Selenium iFrame - 如何移動鼠標和點擊? 有js的事件。 我真的不知道,如何用 python selenium 制作它。
element_to_hover_over = driver.find_element_by_xpath('/html/body/div/div/section/div/div[1]/div/div/div[1]/div[2]/div')
hover = ActionChains(driver).move_to_element(element_to_hover_over)
hover.perform()
我試過這個方法,但是沒有用。
對我來說 pyautogui 起作用了。
import pyautogui
pyautogui.click(x,y)
您可以通過提供合適的 time.sleep() 將其與硒結合使用
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.