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

运行结果

相关推荐
段一凡-华北理工大学1 小时前
【高炉炼铁领域炉温监测、预警、调控智能体设计与应用】~系列文章06:智能决策:从经验驱动到数据驱动
网络·人工智能·数据挖掘·高炉炼铁·工业智能体·高炉炉温
时空系2 小时前
第7篇:功能——打造你的工具箱 Rust中文编程
开发语言·网络·rust
BizViewStudio3 小时前
甄选方法:2026 企业新媒体代运营的短视频精细化运营与流量转化技巧
大数据·网络·人工智能·媒体
凯瑟琳.奥古斯特3 小时前
NAT原理及作用详解
网络·网络协议
网络工程小王4 小时前
【企业中小型网络架构设计】
网络
七夜zippoe4 小时前
OpenClaw Skills 高级开发指南
服务器·网络·人工智能·skills·openclaw
想唱rap4 小时前
应用层协议与序列化
linux·运维·服务器·网络·数据结构·c++·算法
KnowSafe4 小时前
Certificate Lifecycle Management:企业证书管理的终极解决方案
网络
江南风月4 小时前
WGCLOUD如果使用SQL Server数据库推荐哪个版本
运维·网络·zabbix·运维开发·prometheus
GottdesKrieges5 小时前
OceanBase备份常见问题
linux·网络·oceanbase