python - 使用 Python 从 Web 服务中提取数据
问题描述
我请求访问 Web 服务以使用 Python 从在线数据库中检索数据。数据是数字数组。
他们给了我这两件事:
<DailyReport xmlns="http://...">
<DataFilter>
<Header>
<LineCode>{{LINE_CODE}}</LineCode>
<StartDate>2019-08-20 00:00:00</StartDate>
<EndDate>2019-08-30 00:00:00</EndDate>
<WoType>Standard</WoType>
</Header>
<ViewsType>
<View>WorkAction</View>
<View>Event</View>
<View>Movement</View>
<View>Stop</View>
<View>Stock</View>
<View>Shift Log</View>
<View>WorkingHours</View>
<View>numberOfCoffee</View>
</ViewsType>
</DataFilter>
</DailyReport>
Services/Rapport/DMRSVC.svc/DMRRESTService/GetDMRView
我的问题是没有人能告诉我它是什么或如何使用它。请注意,我在 和 之间隐藏了 url 和变量名
例如通过这样做:
import requests
url = "http://..."
reponse = requests.get(url)
print(reponse)
错误 :
ConnectionError: HTTPConnectionPool(host='...', port=80): Max retries exceeded with url: ... (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001FED1801E08>: Failed to establish a new connection: [WinError 10060] Une tentative de connexion a échoué car le parti connecté n’a pas répondu convenablement au-delà d’une certaine durée ou une connexion établie a échoué car l’hôte de connexion n’a pas répondu'))
我还尝试在 request.get 方法中操作“标题”,但没有结果。我真的不知道该怎么办。
解决方案
推荐阅读
- django - 在 Google App Engine 上使用 Wagtail 上传图像会导致 OSError:[Errno 30] 只读文件系统
- javascript - 使用日期选择器事件 vuetify 自定义组件
- python - 我不知道如何在 Python3 的循环中获取要更新的参数
- asp.net - 在页面加载 vb.net 上创建的重复记录
- c# - 我想在两个脚本中使用一个 int 并在第二个脚本中减少它
- django - 我无法使用我使用的方法登录,我曾尝试使用身份验证方法,但它不起作用有人能指出我正确的方向吗
- ceph - Ceph OSD 已满,但我没有存储那么多数据
- powershell - 通过将字符串从文件名的后面移动到前面来重命名文件名
- c# - EF Core 工具版本“3.1.2”比运行时“3.1.7”旧。更新工具以获取最新功能和错误修复
- php - 此路由不支持 GET 方法。支持的方法:HEAD