adding more parameters to the function

This commit is contained in:
Kadir Tugan 2023-11-18 12:38:54 +02:00
parent d49b11e28b
commit 31d760cf30

View file

@ -21,20 +21,20 @@ headers = {
@cache.memoize()
def listing_query(page: int, min_bedrooms: int, max_bedrooms: int):
print("Executing")
def listing_query(page: int, min_bedrooms: int, max_bedrooms: int, radius: float, min_price: int, max_price: int):
print("Querying")
params = {
"locationIdentifier": "POSTCODE^4228216",
"channel": "BUY",
"page": str(page),
"numberOfPropertiesPerPage": "25",
"radius": "5.0",
"radius": str(radius),
"sortBy": "distance",
"includeUnavailableProperties": "false",
"propertyTypes": "flat",
"dontShow": "sharedOwnership,retirement",
"minPrice": "150000",
"maxPrice": "500000",
"minPrice": str(min_price),
"maxPrice": str(max_price),
"minBedrooms": str(min_bedrooms),
"maxBedrooms": str(max_bedrooms),
"apiApplication": "ANDROID",
@ -54,7 +54,7 @@ def listing_query(page: int, min_bedrooms: int, max_bedrooms: int):
if __name__ == "__main__":
response = listing_query(1, 2, 2)
response = listing_query(page=1, min_bedrooms=2, max_bedrooms=2, radius=5.0, min_price=150000, max_price=700000)
resp = response
for d in resp["properties"]:
rl = RightmoveListing(