store_reviews.py 373 B

12345678910111213
  1. from .scrapper import scrape_reviews
  2. from .utils import get_max_date, store_into_database
  3. def populate_yelp_reviews(location, n_pages):
  4. location_url = location.url
  5. max_date = get_max_date(location)
  6. reviews = scrape_reviews(
  7. location_url=location_url,
  8. max_date=max_date,
  9. n_pages=n_pages
  10. )
  11. store_into_database(reviews, location)