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_info[0], 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服务,发现这个出现了问题。我们关闭重新启动一下

运行结果

相关推荐
xixixi7777713 小时前
SOC(安全运营中心)
网络·安全·soc·安全运营中心
想成为大佬的每一天16 小时前
Linux驱动之V4L2
网络
Lowjin_21 小时前
计算机网络-RIP协议
网络·计算机网络·智能路由器
问道飞鱼1 天前
【数据库知识】TxSQL 主从数据库同步底层原理深度解析
网络·数据库·半同步复制·txsql
骥龙1 天前
粤港澳全运会网络安全防御体系深度解析:威胁态势与实战防护
网络·安全·web安全
漫谈网络1 天前
InfiniBand 深度解析
网络·rdma·infiniband·roce v2
海域云赵从友1 天前
从直播卡顿到流畅带货:SD-WAN网络专线如何优化阿联酋TikTok体验?
网络
Saniffer_SH1 天前
【高清视频】CXL 2.0 over Fibre演示和答疑 - 将内存拉到服务器10米之外
运维·服务器·网络·人工智能·驱动开发·计算机外设·硬件工程
jyan_敬言1 天前
【Docker】docker网络配置
网络·docker·容器
apple_ttt1 天前
范式革命:RDMA 如何让网络成为 “分布式内存总线”
网络·计算机网络·数据中心·rdma·数据中心网络