PyZillow не возвращает информацию о недвижимости - PullRequest
0 голосов
/ 14 марта 2019

Я пытаюсь заставить PyZillow API возвращать атрибут property_size, но код выдает ошибку, я не уверен, что понимаю.

Ниже приведен мой код:

from pyzillow.pyzillow import ZillowWrapper, GetDeepSearchResults, GetUpdatedPropertyDetails

#My Address Details
address = '155 Demar Blvd, Canonsburg, PA'
zipcode = '15317'

#My API Key Details
zillow_data = ZillowWrapper('X1-**************_*****') #this is my ZWSID

#Getting the Zillow ID for my property (runs correctly, returns correct ID)
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)) #Checked the type to verify "result.zillow" was same type as "zillow_id" below

Zillow_id = result.zillow_id
print(Zillow_id)
print(type(Zillow_id))

#Section does not run --> returns a UnicodeEncodeError...
updated_property_details_response = zillow_data.get_updated_property_details(Zillow_id)
resultPropDetail = GetUpdatedPropertyDetails(updated_property_details_response)
print(resultPropDetail.property_size)

Я получаю следующие выходные сообщения:

/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 "/Users/jeremypepper/Desktop/Pepperidge Code/SqFtGet.py"
49785503
<type 'str'>
49785503
<type 'str'>
Traceback (most recent call last):
  File "/Users/jeremypepper/Desktop/Pepperidge Code/SqFtGet.py", line 21, in <module>
    updated_property_details_response = zillow_data.get_updated_property_details(Zillow_id)
  File "/Library/Python/2.7/site-packages/pyzillow/pyzillow.py", line 43, in get_updated_property_details
    return self.get_data(url, params)
  File "/Library/Python/2.7/site-packages/pyzillow/pyzillow.py", line 72, in get_data
    response = ElementTree.fromstring(request.text)
  File "<string>", line 124, in XML
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2026' in position 3355: ordinal not in range(128)

Process finished with exit code 1

Есть идеи, что может быть не так?Возможно, это ошибка в API?

...