47 lines
1.6 KiB
Python
47 lines
1.6 KiB
Python
import best_restaurants_scraping_v2
|
|
import gault_et_millau_scraping_v2
|
|
import le_fooding_scraping
|
|
import petit_fute_scraping_v2
|
|
import resto_de_paris_scraping
|
|
import google_scraping
|
|
|
|
import datetime
|
|
from icecream import ic
|
|
|
|
|
|
def main():
|
|
# Choose desired path to export scraped data
|
|
desired_path = '/Users/oliviermeyer/Desktop/'
|
|
|
|
# Initial scraping
|
|
df1 = best_restaurants_scraping_v2.complete_scraping()
|
|
# df2 = gault_et_millau_scraping_v2.complete_scraping()
|
|
df3_1 = le_fooding_scraping.complete_scraping()
|
|
df4_1 = petit_fute_scraping_v2.complete_scraping()
|
|
df5 = resto_de_paris_scraping.complete_scraping()
|
|
|
|
# Google scraping for dataframe without menus
|
|
df3_2 = google_scraping.google_scrap_fooding(df3_1)
|
|
df4_2 = google_scraping.google_scrap_fute(df4_1)
|
|
|
|
# Get today's date in string
|
|
date = str(datetime.date.today())
|
|
|
|
# Export all the dataframes
|
|
df1.to_csv(desired_path + 'best_restaurants_' + date + '.csv', index=False, header=True, escapechar='\\')
|
|
# df2.to_csv(desired_path + 'gault_et_millau_' + date + '.csv', index=False, header=True, escapechar='\\')
|
|
df3_2.to_csv(desired_path + 'le_fooding_' + date + '.csv', index=False, header=True, escapechar='\\')
|
|
df4_2.to_csv(desired_path + 'petit_fute_' + date + '.csv', index=False, header=True, escapechar='\\')
|
|
df5.to_csv(desired_path + 'resto_de_paris_' + date + '.csv', index=False, header=True, escapechar='\\')
|
|
|
|
|
|
# List of days that have been processed
|
|
done_dates = []
|
|
|
|
# Call the main function every new day
|
|
while True:
|
|
today = datetime.date.today()
|
|
if today not in done_dates:
|
|
ic()
|
|
main()
|