首页 > 解决方案 > 通过 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)

标签: pythonxmlreporting-services

解决方案


推荐阅读