NetEaseGame / ATX

Smart phone automation tool. Support iOS, Android, WebApp and game.
Apache License 2.0
1.58k stars 422 forks source link

找图命令报错 #171

Closed bsshanghai closed 6 years ago

bsshanghai commented 6 years ago

Version information

encoding=utf-8

import os import sys import time import atx from atx.ext import report

d = atx.connect()#通过usb连接 pic_str="F:\dr2\snapshot\"

image_name=pic_str+'ghicon.1280x800.png' d.wait(image_name)

D:\Python27-64bit\python.exe F:/dr2/guide/game_guild.py 2018-02-24 15:29:54.259 WARN [atx.drivers.mixin: 407] warning, screenshot failed [2/1], retry again Traceback (most recent call last): File "F:/dr2/guide/game_guild.py", line 13, in d.wait(image_name) File "D:\Python27-64bit\lib\site-packages\atx\drivers\mixin.py", line 161, in wait ret = self.exists(pattern, match_kwargs) File "D:\Python27-64bit\lib\site-packages\atx\drivers\mixin.py", line 150, in exists ret = self.match(pattern, match_kwargs) File "D:\Python27-64bit\lib\site-packages\atx\drivers\mixin.py", line 274, in match screen = screen or self.region_screenshot() File "D:\Python27-64bit\lib\site-packages\atx\drivers\mixin.py", line 380, in region_screenshot screen = self.last_screen if self.__keep_screen else self.screenshot() File "D:\Python27-64bit\lib\site-packages\atx\drivers\mixin.py", line 62, in _inner _retval = fn(*args, **kwargs) File "D:\Python27-64bit\lib\site-packages\atx\drivers\mixin.py", line 408, in screenshot screen = self._take_screenshot() File "D:\Python27-64bit\lib\site-packages\atx\drivers\android.py", line 244, in _take_screenshot return self._uiauto.screenshot() File "", line 2, in screenshot File "D:\Python27-64bit\lib\site-packages\retry\api.py", line 74, in retry_decorator logger) File "D:\Python27-64bit\lib\site-packages\retry\api.py", line 33, in retry_internal return f() File "D:\Python27-64bit\lib\site-packages\uiautomator2__init__.py", line 1006, in screenshot r = requests.get(self.server.screenshot_uri, timeout=10) File "D:\Python27-64bit\lib\site-packages\requests\api.py", line 72, in get return request('get', url, params=params, kwargs) File "D:\Python27-64bit\lib\site-packages\requests\api.py", line 58, in request return session.request(method=method, url=url, kwargs) File "D:\Python27-64bit\lib\site-packages\requests\sessions.py", line 508, in request resp = self.send(prep, send_kwargs) File "D:\Python27-64bit\lib\site-packages\requests\sessions.py", line 618, in send r = adapter.send(request, kwargs) File "D:\Python27-64bit\lib\site-packages\requests\adapters.py", line 508, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=3359): Max retries exceeded with url: /screenshot/0 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x00000000065A50F0>: Failed to establish a new connection: [Errno 10061] ',))

codeskyblue commented 6 years ago

需要先init 才行,看首页的文档

bsshanghai commented 6 years ago

python -muiautomator2 init 这个肯定先success了的。但是还是报这个错。前几天找图还没问题的.

--- HTTPConnectionPool(host='127.0.0.1', port=3359) 每次运行,报错的时候这个port后面的数值还会变....

bsshanghai commented 6 years ago

无能为力的我眼泪掉下来.只好退到atx 1.1.1版本.