Open SirWillae opened 1 week ago
I wasn't able to replicate the issue. Could you try using a VPN or a proxy to check if it works? It's working well on my side. What probably happened is that you were making multiple calls to Zillow's server, and it flagged your IP
I apologize. I just tried it again and it worked - without a VPN. The only thing I did differently is I created a new virtual environment, so I could send over a package list. So... don't know what to tell you. Sorry to waste your time.
Tried running the sample code and got a JSON Decode error. Here is the stack trace:
JSONDecodeError Traceback (most recent call last) Cell In[4], line 13 8 #pagination is for the list that you see at the right when searching 9 #you don't need to iterate over all the pages because zillow sends the whole data on mapresults at once on the first page 10 #however the maximum result zillow returns is 500, so if mapResults is 500 11 #try playing with the zoom or moving the coordinates, pagination won't help because you will always get at maximum 500 results 12 pagination = 1 ---> 13 results_sold = pyzill.sold(pagination, ne_lat,ne_long,sw_lat,sw_long,zoom_value, "") 14 results_sale = pyzill.for_sale(pagination, ne_lat,ne_long,sw_lat,sw_long,zoom_value, "") 15 results_rent = pyzill.for_rent(pagination, ne_lat,ne_long,sw_lat,sw_long,zoom_value, "")
File ~/sandbox/lib/python3.10/site-packages/pyzill/search.py:120, in sold(pagination, ne_lat, ne_long, sw_lat, sw_long, zoom_value, proxy_url) 89 """get results of the listing that were sold, you will get a dictionary with the keywords 90 mapResults and listResults, use mapResults which contains all the listings from all paginations 91 listResults is more for the right side bar that you see when searching on zillow. (...) 106 dict[str, Any]: listing of properties in JSON format 107 """ 108 rent = { 109 "sortSelection": {"value": "globalrelevanceex"}, 110 "isNewConstruction": {"value": False}, (...) 118 "isRecentlySold": {"value": True}, 119 } --> 120 return search(pagination,ne_lat,ne_long,sw_lat,sw_long,zoom_value,rent,proxy_url)
File ~/sandbox/lib/python3.10/site-packages/pyzill/search.py:195, in search(pagination, ne_lat, ne_long, sw_lat, sw_long, zoom_value, filter_state, proxy_url) 187 proxies = {"http": proxy_url, "https": proxy_url} if proxy_url else None 188 response = requests.put( 189 url="https://www.zillow.com/async-create-search-page-state", 190 json=inputData, (...) 193 impersonate="chrome110", 194 ) --> 195 data = response.json() 196 return data.get("cat1", {}).get("searchResults", {})
File ~/sandbox/lib/python3.10/site-packages/curl_cffi/requests/models.py:200, in Response.json(self, kw) 198 def json(self, kw): 199 """return a parsed json object of the content.""" --> 200 return loads(self.content, **kw)
File /usr/lib/python3.10/json/init.py:346, in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw) 341 s = s.decode(detect_encoding(s), 'surrogatepass') 343 if (cls is None and object_hook is None and 344 parse_int is None and parse_float is None and 345 parse_constant is None and object_pairs_hook is None and not kw): --> 346 return _default_decoder.decode(s) 347 if cls is None: 348 cls = JSONDecoder
File /usr/lib/python3.10/json/decoder.py:337, in JSONDecoder.decode(self, s, _w) 332 def decode(self, s, _w=WHITESPACE.match): 333 """Return the Python representation of
s
(astr
instance 334 containing a JSON document). 335 336 """ --> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 338 end = _w(s, end).end() 339 if end != len(s):File /usr/lib/python3.10/json/decoder.py:355, in JSONDecoder.raw_decode(self, s, idx) 353 obj, end = self.scan_once(s, idx) 354 except StopIteration as err: --> 355 raise JSONDecodeError("Expecting value", s, err.value) from None 356 return obj, end
JSONDecodeError: Expecting value: line 1 column 1 (char 0)