Python Selenium iFrame-如何移动鼠标并单击?

时间:2018-10-01 14:36:02

标签: python selenium

Python Selenium iFrame-如何移动鼠标并单击? js有事件。我真的不知道,如何用python硒。

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()

我尝试了这种方法,但是没有用。

1 个答案:

答案 0 :(得分:0)

pyautogui对我有用。

import pyautogui
pyautogui.click(x,y)

您可以通过提供适当的时间使其与硒结合。sleep()