The lists i am passing in the pyzillow API
add_list = ['913 COMANCHE DR OXON HILL MD ','70 CLAY ST ANNAPOLIS MD ','9125 SCOTT ST SPRINGFIELD VA ']
zip_list = [20745, 21401, 22153]
This is the API I am running
from pyzillow.pyzillow import ZillowWrapper, GetDeepSearchResults
hometype = []
for add,zip_code in zip(add_list,zip_list):
address = add
zipcode = zip_code
zillow_data = ZillowWrapper('X1-ZWz18uczm57uvf_56tmg')
deep_search_response = zillow_data.get_deep_search_results(address, zipcode)
result = GetDeepSearchResults(deep_search_response)
hometype.append(result.home_type)
This runs perfectly and gives proper output
But when I use these lists
add_list_edited = ['913 COMANCHE DR OXON HILL MD ','16640 HARWOOD OAKS CT DUMFRIES VA ','70 CLAY ST ANNAPOLIS MD ','9125 SCOTT ST SPRINGFIELD VA ']
zip_list_edited = [20745, 22026, 21401, 22153]
I get following error on running the same API
TypeError: __str__ returned non-string (type dict)
I checked that the second address in list isnt specific hence the scraper is throwing error. I removed it and the code worked but the issue is I used trial and error on only 4 elements. I am working on large number of elements and after dropping values having the second address i ran the code and again it threw the same error but its virtually impossible to identify which address is giving a problem. Is there a way to add exception to the loop? I dont mind dropping values which give me errors. Any suggestion would be welcome.