-
-
Save bahrammp/1d0287abbbe7a2b757e3d885347f665e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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