我正在尝试使用以下代码获取Zillow ID:
from pyzillow.pyzillow import ZillowWrapper, GetDeepSearchResults,GetUpdatedPropertyDetails
address = '1600 Pennsylvania Ave NW, Washington, DC'
zipcode = '20006'
zillow_data = ZillowWrapper('API Key')
deep_search_response = zillow_data.get_deep_search_results(address,zipcode)
result = GetDeepSearchResults(deep_search_response)
print(result.zillow_id) 有没有关于为什么上面的方法不起作用的想法?下面是错误:
ZillowFail Traceback (most recent call last)
<ipython-input-12-7f34d0e7b6f0> in <module>()
3 zipcode = '60053'
4 zillow_data = ZillowWrapper('API Key')
----> 5 deep_search_response = zillow_data.get_deep_search_results(address,zipcode)
6 result = GetDeepSearchResults(deep_search_response)
7 print(result.zillow_id)
/home/mfranzidis/pyenvs/numeric/lib/python2.7/site-packages/pyzillow/pyzillow.pyc in get_deep_search_results(self, address, zipcode)
29 'zws-id': self.api_key
30 }
---> 31 return self.get_data(url, params)
32
33 def get_updated_property_details(self, zpid):
/home/mfranzidis/pyenvs/numeric/lib/python2.7/site-packages/pyzillow/pyzillow.pyc in get_data(self, url, params)
62 requests.exceptions.TooManyRedirects,
63 requests.exceptions.Timeout):
---> 64 raise ZillowFail
65
66 try:
ZillowFail: 发布于 2018-11-13 21:14:02
这看起来像是Zillow API的问题。正如你所看到的,它失败了,出现了一个requests too side异常,所以可能会有一些东西在它们的API端以一个重定向循环结束:
/home/mfranzidis/pyenvs/numeric/lib/python2.7/site-packages/pyzillow/pyzillow.pyc in get_data(self, url, params)
62 requests.exceptions.TooManyRedirects,他们的库没有很好地处理这一问题,在这种情况下,它似乎抛出了一个带有空消息的ZillowFail异常。
https://stackoverflow.com/questions/53272353
复制相似问题