Python 如何通过给定x,y坐标,使用selnium(或任何其他Web驱动程序)在网站上移动鼠标

Python 如何通过给定x,y坐标,使用selnium(或任何其他Web驱动程序)在网站上移动鼠标,python,selenium,selenium-chromedriver,pyautogui,Python,Selenium,Selenium Chromedriver,Pyautogui,如何在没有元素的情况下在站点上自由移动鼠标?(没有我像在后台那样与它互动。 它是用python和pyautogui编写的,用于获取光标的位置。只需将坐标输入pyautogui的moveTo方法: while True: cursorx, cursory = pyautogui.position() body = driver.find_element_by_css_selector("body") actions.move_to_element_wit

如何在没有元素的情况下在站点上自由移动鼠标?(没有我像在后台那样与它互动。
它是用python和pyautogui编写的,用于获取光标的位置。

只需将坐标输入pyautogui的moveTo方法:

while True:
    cursorx, cursory = pyautogui.position()
    body = driver.find_element_by_css_selector("body")
    actions.move_to_element_with_offset(body, cursorx, cursory)

Selenium的设计并没有考虑到这个场景。你想做什么?为什么不能引用元素?@JeffC,因为我正在为一个需要它的游戏制作一个机器人。这仍然不是很多信息。所以这个游戏是HTML5应用程序还是?
pyautogui.moveTo(x=1043, y=606)