我正在运行一个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:更新包配置
-->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
repo:的末尾
- 为了避免依赖X,Linux部分读取原始设备文件(
/dev/input/input*
(,但这需要root
为了自动化web UI交互,我建议尝试使用python的Selenium web驱动程序,而不是webbot
和mouse
模块。以下是有关如何使用的文档。