我正在使用请求包表单 pandasdmx 库来访问欧洲中央银行的一些汇率。我尝试遵循以下演练中突出显示的步骤:https ://pandasdmx.readthedocs.io/en/v1.0/walkthrough.html# bur,当我尝试访问不同的数据流时,它给了我一个错误。这是我正在使用的代码:
import pandasdmx as sdmx
ecb = sdmx.Request('ECB')
ecb_via_proxy = sdmx.Request('ECB',proxies={'http': 'http://1.2.3.4:5678'})
flow_msg = ecb.dataflow()
flow_msg = ecb.dataflow()
Traceback (most recent call last):
File "<ipython-input-8-9011799aab2e>", line 1, in <module>
flow_msg = ecb.dataflow()
File "C:\Users\gcperez\AppData\Local\Continuum\anaconda3\lib\site-packages\pandasdmx\api.py", line 361, in get
base_url, params=params, headers=headers, fromfile=fromfile)
File "C:\Users\gcperez\AppData\Local\Continuum\anaconda3\lib\site-packages\pandasdmx\remote.py", line 98, in get
url, params=params, headers=headers)
File "C:\Users\gcperez\AppData\Local\Continuum\anaconda3\lib\site-packages\pandasdmx\remote.py", line 118, in request
with closing(requests.get(url, params=params, **cur_config)) as response:
File "C:\Users\gcperez\AppData\Local\Continuum\anaconda3\lib\site-packages\requests\api.py", line 76, in get
return request('get', url, params=params, **kwargs)
File "C:\Users\gcperez\AppData\Local\Continuum\anaconda3\lib\site-packages\requests\api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\gcperez\AppData\Local\Continuum\anaconda3\lib\site-packages\requests\sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\gcperez\AppData\Local\Continuum\anaconda3\lib\site-packages\requests\sessions.py", line 665, in send
history = [resp for resp in gen] if allow_redirects else []
File "C:\Users\gcperez\AppData\Local\Continuum\anaconda3\lib\site-packages\requests\sessions.py", line 665, in <listcomp>
history = [resp for resp in gen] if allow_redirects else []
File "C:\Users\gcperez\AppData\Local\Continuum\anaconda3\lib\site-packages\requests\sessions.py", line 166, in resolve_redirects
raise TooManyRedirects('Exceeded {} redirects.'.format(self.max_redirects), response=resp)
TooManyRedirects: Exceeded 30 redirects.
我以前多次使用过这种访问方式,没有出现任何问题。¿ 有人知道会发生什么吗?