Skyexu / TopSup

答题辅助决策:头号英雄等答题类游戏
https://www.jianshu.com/p/dc828c4b901d
1.32k stars 351 forks source link

不能建立连接?这是什么神奇的错误。python GetQuestionTessIos.py 报错 #73

Closed bowensun closed 6 years ago

bowensun commented 6 years ago

运行python GetQuestionTessIos.py 时报错,没太搞明白是哪里出了问题,谢谢帮助

MacBook-Pro-4:TopSup-master noah$ python GetQuestionTessIos.py retry to connect, error: HTTPConnectionPool(host='localhost', port=8100): Max retries exceeded with url: /screenshot (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10364dfd0>: Failed to establish a new connection: [Errno 61] Connection refused',)) Traceback (most recent call last): File "GetQuestionTessIos.py", line 18, in c.screenshot('screenshot.png') File "/Library/Python/2.7/site-packages/wda/init.py", line 295, in screenshot value = self.http.get('screenshot').value File "/Library/Python/2.7/site-packages/wda/init.py", line 101, in fetch return self._fetch_no_alert(method, url, data) File "/Library/Python/2.7/site-packages/wda/init.py", line 107, in _fetch_no_alert return httpdo(target_url, method, data) File "/Library/Python/2.7/site-packages/wda/init.py", line 75, in httpdo response = requests.request(method, url, data=data, timeout=HTTP_TIMEOUT) File "/Library/Python/2.7/site-packages/requests/api.py", line 58, in request return session.request(method=method, url=url, kwargs) File "/Library/Python/2.7/site-packages/requests/sessions.py", line 508, in request resp = self.send(prep, send_kwargs) File "/Library/Python/2.7/site-packages/requests/sessions.py", line 618, in send r = adapter.send(request, **kwargs) File "/Library/Python/2.7/site-packages/requests/adapters.py", line 508, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8100): Max retries exceeded with url: /screenshot (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10366e710>: Failed to establish a new connection: [Errno 61] Connection refused',))

bowensun commented 6 years ago

iOS + Mac 坑太多了,填了一个又一个。

这个是因为端口没有转发,设置一下即可。不过这话还有其他的坑

btc99999 commented 6 years ago

说下我的解决方法,我是mac和iphone在一个局域网里,把GetQuestionTessIos.py文件里 c = wda.Client()改成c = wda.Client('http://192.168.0.101:8100') 其中192.168.0.101是iphone的局域网ip