forked from pascalweiss/LSFEventScraper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
34 lines (23 loc) · 1001 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from LSFEventScraper import LSFEventScraper
from LSFEventType import LSFEventType
__author__ = 'pascal'
scraper = LSFEventScraper(event_type=LSFEventType.normal_event, logging=False)
# FIRST SCENARIO
#===============
# - Fetches all events from HTW-Berlin.de and stores them to memory.
scraper.scrape_events()
# - Sends a TRUNCATE command to the database, to delete all current rows.
scraper.db_access.reset()
# - Sends saves all events to the database.
scraper.save_events_to_db()
# SECOND SCENARIO
#================
# - Fetches all day-overviews and stores them as html files to ./data_events/
# scraper.crawl_day_pages_and_save_to_disk()
# - ...Later... After you've fetched the pages, you can scrape and store the events later.
# - Scrapes all local sites and stores them to memory
#scraper.scrape_local_sites()
# - Sends a TRUNCATE command to the database, to delete all current rows.
#scraper.db_access.reset()
# - Sends saves all events to the database.
#scraper.save_events_to_db()