python - 通过 Python 中的 URL 从 SQL Server 中提取数据
问题描述
我需要通过带有嵌入式 url 的 xml 或 atomvc 文件从安全网站中提取数据。由于授权问题,我无法通过 python BS4 或请求访问,但没有 Python,我可以正常访问链接和 SQL 数据库。我只是想通过 url 提取所有数据,然后将其保存到另一个文件中。那可能吗?任何帮助都是极好的。谢谢!
编辑:这是我到目前为止所尝试的。它下载一个文件,但它是未经授权访问的 html,但是当我在没有 Python 的情况下访问 url 时,我可以访问它。
import xml.etree.ElementTree as ET
import wget
root = ET.parse('Live Workload Report.atomsvc').getroot()
att = []
for i in root[0]:
att.append(i.attrib)
href = att[1]['href']
filename = wget.download(href)
解决方案
推荐阅读
- java - 我在某些 android 设备上没有收到 firebase otp
- java - Tomcat 提供内容类型为“text/html”而不是 JNLP 内容类型的 JNLP 文件
- bash - 使用 csh 全新安装后“brew:找不到命令”,PATH 是正确的
- listview - 有什么方法可以在 Flutter 的 ListView 上找到中心项位置?
- vba - 使用 DAO 和 VBA 的 ODBC 连接创建直通 QueryDef
- java - 使用杰克逊数据绑定注释将java对象附加到另一个对象
- git - 尝试推送到远程存储库时,我在 Sourcetree 上收到此 403 Forbidden 错误:
- html - 更改 svg 中 html 的字体大小
- apache-nifi - 日期到季度
- angular - 如何使用 Angular 7 中的 id 隐藏动态 div