繁体   English   中英

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

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

我正在运行 python repl.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:更新 package 配置

--> python3 -m 诗歌添加鼠标

对鼠标使用 ^0.7.1 版本

然后产生以下错误:

[RecursionError]
maximum recursion depth exceeded
exit status 1


Repl.it: Package operation failed.

我以前从未遇到过这样的错误,任何帮助将不胜感激!

mouse模块需要linux 中的 root 访问权限这对runner (即 repl.it 用户)不可用 请参阅mouse PyPI 描述mouse存储库末尾的“已知限制”:

  • 为了避免依赖于 X,Linux 部件读取原始设备文件( /dev/input/input* ),但这需要 root。

为了自动化 web UI 交互,我建议尝试 Selenium web 驱动程序mouse不是 web 模块的webbot模块。 是有关如何使用的文档。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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