简体   繁体   中英

Python Selenium iFrame - how to move mouse and click?

Python Selenium iFrame - how to move mouse and click? There are the events with js. I dont really know, how to make it with 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()

I tried this method, but it didnt work.

For me pyautogui worked.

import pyautogui
pyautogui.click(x,y)

You can combine it with selenium by giving suitable time.sleep()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM