Skip to content

Instantly share code, notes, and snippets.

@bahrammp
Last active August 6, 2018 16:52
Show Gist options
  • Save bahrammp/1d0287abbbe7a2b757e3d885347f665e to your computer and use it in GitHub Desktop.
Save bahrammp/1d0287abbbe7a2b757e3d885347f665e to your computer and use it in GitHub Desktop.
def get_comments_for_restaurant_page(restaurant_name,page_number=0):
http = urllib3.PoolManager()
base_api_url = 'https://www.snappfood.ir/restaurant/comment/vendor/{}/{}'
r = http.request('GET', base_api_url.format(restaurant_name,page_number))
json_data = json.loads(r.data.decode('utf-8'))
if json_data['status'] != True:
print('error in loading restaurant information ',restaurant_name)
return -1;
return json_data;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment