从使用 pyzillow,python,web-scraping"/>

首页 > 解决方案 > 一个错误从使用 pyzillow

问题描述

我使用 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,它会一直向我报告此错误。我不知道我错在哪里。有人可以帮忙吗?感谢您的任何帮助!

标签: pythonweb-scraping

解决方案


推荐阅读