使用pyzillow导致错误<exception str()=“” failed =“”>

时间:2019-04-30 06:45:53

标签: python web-scraping

我用pyzillow软件包抓取了房屋的信息。但是我一直出错:

Traceback (most recent call last):
  File "/Users/wangguijie/Documents/Codes/日常python/zilloww/zillowscraping.py", line 21, in <module>
    updated_property_details_response = zillow_data.get_updated_property_details(zpid = Zillow_id)
  File "/Applications/anaconda3/lib/python3.7/site-packages/pyzillow/pyzillow.py", line 43, in get_updated_property_details
    return self.get_data(url, params)
  File "/Applications/anaconda3/lib/python3.7/site-packages/pyzillow/pyzillow.py", line 82, in get_data
    raise ZillowError(int(response.findall('message/code')[0].text))
pyzillow.pyzillowerrors.ZillowError: <exception str() failed>

我只是不知道哪里错了。

from pyzillow.pyzillow import ZillowWrapper, GetDeepSearchResults, GetUpdatedPropertyDetails
address = '16366 Brisk Breeze Aly,Winter Garden, FL'
zipcode = '34787'
zillow_data = ZillowWrapper('X1-********')
deep_search_response = zillow_data.get_deep_search_results(address,zipcode)


result = GetDeepSearchResults(deep_search_response)
print(result.zillow_id)
print(type(result.zillow_id))
print(result.home_type)

Zillow_id = result.zillow_id
print(type(Zillow_id))
print(Zillow_id)
Zillow_data = ZillowWrapper('X1-*******')
updated_property_details_response = zillow_data.get_updated_property_details(zpid = Zillow_id)
result = GetUpdatedPropertyDetails(updated_property_details_response)
# print(48749425)
print(result.home_type)

如果我使用了另一个Zillow_id,例如“ 48749425”,则没有任何错误,一切都很好。但是,如果我使用从GetDeepSearchResults获得的结果中减去的Zillow_id,它将继续向我报告此错误。我不知道我哪里错了。有人可以帮忙吗?谢谢您的帮助!

0 个答案:

没有答案