【问题标题】:Extracting data from the ECB Data Warehouse从欧洲央行数据仓库中提取数据
【发布时间】:2021-05-05 19:23:05
【问题描述】:

我想用 Pandas 提取 this page 中 ECB 数据仓库的给定值。

我一直在查看ECB help page,但找不到让它工作的方法。

我已经尝试了以下代码:

# Building blocks for the URL
entrypoint = 'https://sdw-wsrest.ecb.europa.eu/service/' # Using protocol 'https'
resource = 'data'           
flowRef ='BSI'              
key = 'M.AT.N.A.L20.A.1.U2'    

# Define the parameters
parameters = {
    'startPeriod': '2020-01-01',  # Start date of the time series
    'endPeriod': '2020-12-31'     # End of the time series
}  

request_url = entrypoint + resource + '/'+ flowRef + '/' + key
        
    # Make the HTTP request
    response = requests.get(request_url, params=parameters)
    
    # Check if the response returns succesfully with response code 200
    print(response)
    
    # Print the full URL
    print(response.url)

我不断收到错误代码:

ProxyError: HTTPSConnectionPool - OSError('Tunnel connection failed: 407 Proxy Authentication Required')))

如果有人能帮助我,我将非常感激。

【问题讨论】:

    标签: python pandas web-scraping https request


    【解决方案1】:

    您需要设置 HTTPS_PROXY 才能离开您的网络 :)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-12
      相关资源
      最近更新 更多