UiAutomator weditor 连接报错 HTTPConnectionPool(host='localhost', port=8100): Max retries exceeded with url

liu · 2021年04月16日 · 最后由 Lily酱ByHeart 回复于 2021年09月13日 · 453 次阅读

最近在做 IOS 自动化,需要用 weditor 定位部分元素。但通过 python3 -m weditor 启动 weditor 后,connect 报错,目前还没解决。麻烦有经验的大佬给瞧一瞧~

报错截图

报错信息

Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/weditor/web/handlers/page.py", line 60, in post
id = connect_device(platform, device_url)
File "/usr/local/lib/python3.7/site-packages/weditor/web/device.py", line 94, in connect_device
d = _AppleDevice(device_url)
File "/usr/local/lib/python3.7/site-packages/weditor/web/device.py", line 61, in init
self.__scale = c.scale
File "/usr/local/lib/python3.7/site-packages/cached_property.py", line 35, in get
value = obj.dict[self.func.name] = self.func(obj)
File "/usr/local/lib/python3.7/site-packages/wda/init.py", line 654, in scale
v = max(self.screenshot().size) / max(self.window_size())
File "/usr/local/lib/python3.7/site-packages/wda/init.py", line 496, in screenshot
value = self.http.get('screenshot').value
File "/usr/local/lib/python3.7/site-packages/wda/init.py", line 409, in _fetch
response = httpdo(url, method, data)
File "/usr/local/lib/python3.7/site-packages/wda/init.py", line 125, in httpdo
return _unsafe_httpdo(url, method, data)
File "/usr/local/lib/python3.7/site-packages/wda/init.py", line 165, in _unsafe_httpdo
timeout=HTTP_TIMEOUT)
File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8100): Max retries exceeded with url: /screenshot (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused'))
共收到 2 条回复 时间 点赞

解决了嘛 大佬

哈喽 请问你解决了没 你的 host 是 wd 输出的地址吗

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册