尝试使用鼠标/导入时,出现递归错误/包操作失败

When trying to use mouse / import, I'm getting a recursion error / package operation fail

我是运行一个pythonrepl.it环境/项目,我的代码如下:

from webbot import Browser
import time
from keyboard import press
import mouse


web = Browser()

tab = 1
add = 1

web.go_to('https://tankster.io')
time.sleep(7.5)

mouse.move(585, 335, absolute=True, duration=0.5)
mouse.click('left')

text_areas = web.find_elements(xpath='//input')
web.type(web.Key.ENTER,into=text_areas[0].text)

time.sleep(3)

global h
h = 100

while(h > 99):
  press('enter')
  time.sleep(5)

启动正常:

Repl.it: 更新包配置

--> python3 -m 诗添加鼠标

鼠标使用版本 ^0.7.1

然后产生以下错误:

[RecursionError]
maximum recursion depth exceeded
exit status 1


Repl.it: Package operation failed.

我以前从未遇到过这样的错误,非常感谢任何帮助!

mouse 模块需要 root access in linux, which is not available to the runner (i.e., the repl.it user). See "known limitations" at the end of the mouse PyPI description or the mouse repo:

  • To avoid depending on X the Linux parts reads raw device files (/dev/input/input*) but this requries root.

为了自动化网络 UI 交互,我推荐 trying Selenium web drivers with python instead of webbot and mouse modules. Here 是关于如何使用的文档。