Skip to content

Commit 9646f1d

Browse files
committed
first function
1 parent a504fd9 commit 9646f1d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

zillow.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ def __init__(self, arg):
1010
self.base = "https://www.zillow.com/webservice/"
1111

1212
def GetSearchResults(self, address, citystatezip):
13-
1413

14+
data = {'zws-id' : self.ZWSID,'address' : address,'citystatezip': citystatezip}
1515

16-
17-
data = {'zws-id' : ZWSID,'address' : "3276 Spyglass Drive",'citystatezip':"98226"}
18-
19-
response = requests.get(base + "GetSearchResults.htm",params=data)
20-
21-
house = xmltodict.parse(response.text)
16+
response = requests.get(base + "GetSearchResults.htm",params=data)
17+
if response.status_code == 200:
18+
return xmltodict.parse(response.text)
19+
else:
20+
return response.status_code

0 commit comments

Comments
 (0)