producer-raw-recipies_3.py 358 B

1234567891011121314
  1. def fetch_raw(recipe_url):
  2. html = None
  3. print('Processing..{}'.format(recipe_url))
  4. try:
  5. r = requests.get(recipe_url, headers=headers)
  6. if r.status_code == 200:
  7. html = r.text
  8. except Exception as ex:
  9. print('Exception while accessing raw html')
  10. print(str(ex))
  11. finally:
  12. return html.strip()