appium中urllib3.exceptions.LocationValueError: No host specified. 的错误解决办法

目录

错误收集

错误分析

解决办法

运行结果


错误收集

D:\Program\Util\python.exe C:\Users\Administrator\PycharmProjects\Appium_Real\demo.py

Traceback (most recent call last):

File "C:\Users\Administrator\PycharmProjects\Appium_Real\demo.py", line 12, in <module>

do_driver = webdriver.Remote('http:127.0.0.1:4723/wd/hub',options=UiAutomator2Options().load_capabilities(cap))

File "D:\Program\Util\Lib\site-packages\appium\webdriver\webdriver.py", line 253, in init

super().init(

~~~~~~~~~~~~~~~~^

command_executor=command_executor,

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

...<3 lines>...

client_config=client_config,

^^^^^^^^^^^^^^^^^^^^^^^^^^^^

)

^

File "D:\Program\Util\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 261, in init

self.start_session(capabilities)

~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^

File "D:\Program\Util\Lib\site-packages\appium\webdriver\webdriver.py", line 344, in start_session

response = self.execute(RemoteCommand.NEW_SESSION, w3c_caps)

File "D:\Program\Util\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 451, in execute

response = cast(RemoteConnection, self.command_executor).execute(driver_command, params)

File "D:\Program\Util\Lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 404, in execute

return self._request(command_info0, url, body=data)

~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "D:\Program\Util\Lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 428, in _request

response = self._conn.request(method, url, body=body, headers=headers, timeout=self._client_config.timeout)

File "D:\Program\Util\Lib\site-packages\urllib3\_request_methods.py", line 143, in request

return self.request_encode_body(

~~~~~~~~~~~~~~~~~~~~~~~~^

method, url, fields=fields, headers=headers, **urlopen_kw

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

)

^

File "D:\Program\Util\Lib\site-packages\urllib3\_request_methods.py", line 278, in request_encode_body

return self.urlopen(method, url, **extra_kw)

~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^

File "D:\Program\Util\Lib\site-packages\urllib3\poolmanager.py", line 448, in urlopen

conn = self.connection_from_host(u.host, port=u.port, scheme=u.scheme)

File "D:\Program\Util\Lib\site-packages\urllib3\poolmanager.py",line 310, in connection_from_host
raise LocationValueError("No host specified.")
urllib3.exceptions.LocationValueError: No host specified.

Process finished with exit code 1

错误分析

urllib3.exceptions.LocationValueError: No host specified.

看这个 语句,host没有明确规定,这个大概意思是说们的host地址写的可能有错误,或者appium出现了问题

解决办法

  1. 滚动到首行

  2. 点击文件 ===》跳转到指定代码。发现这个appium的服务器地址可能有错误,

  3. 这里使用的是最新版的appium,使用的是node版本,这个应该是

    复制代码
    127.0.0.1:4723
  4. 这个是最新的,不要加http和后面的,

  5. 看一下appium服务,发现这个出现了问题。我们关闭重新启动一下

运行结果

相关推荐
梦帮科技11 小时前
领域认知知识库图谱注入:从双式记账图网络到高质量问答对自动化合成流水线
运维·网络·数据库·人工智能·矩阵·架构·自动化
菜鸡养成中...12 小时前
卫星通信协议笔记1-协议栈
网络
hzxpaipai13 小时前
杭州企业官网怎么建设?从策划到上线的5步建站方法
运维·服务器·前端·网络
smartpi_ai13 小时前
通用脱机烧录器为什么烧不进 CI-03?下载协议的门槛、免唤醒 10 条的建议值属性
服务器·网络·ci/cd
ITxiaobing202314 小时前
自研 IP 库与 AppsFlyer 判定不一致的排查实践
网络·网络协议·tcp/ip
2501_9378609414 小时前
中篇:TCP 为什么可靠又高效?滑动窗口、流量控制、拥塞控制与粘包全解析
服务器·网络·tcp/ip
刚及格的陆拾伍15 小时前
Wi-Fi核心知识精要:从频段到帧结构全解析
网络·物联网·网络协议·信息与通信·iot
xiaoye-duck15 小时前
《Linux 网络编程》深入理解 IO 多路复用:select 函数详解与 Echo 服务实战
linux·网络
SDWAN_Cheap16 小时前
TCP滑动窗口与拥塞控制是什么?从流量控制到网络稳定性的完整解析
网络·tcp/ip·php
广东融科数据服务有限公司16 小时前
无网络仓储库房安防监控改造落地案例|离线闭环存储 + 4G 低功耗远程适配实战优化
网络·仓储改造