Spaces:
Running
Running
Alvaro
commited on
Commit
·
ffa92b9
1
Parent(s):
5b07ff1
Update main.py
Browse files- src/scrape/main.py +6 -6
src/scrape/main.py
CHANGED
|
@@ -17,16 +17,16 @@ def main():
|
|
| 17 |
|
| 18 |
# --- Step 1: Scrape Events and Fights ---
|
| 19 |
print("\n--- Starting Events and Fights Scraping ---")
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
print(f"Scraping for events complete. Data saved to {config.EVENTS_JSON_PATH}")
|
| 24 |
|
| 25 |
# --- Step 2: Scrape Fighters ---
|
| 26 |
print("\n--- Starting Fighters Scraping ---")
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
print(f"Scraping for fighters complete. Data saved to {config.FIGHTERS_JSON_PATH}")
|
| 31 |
|
| 32 |
# --- Step 3: Convert JSON to CSV ---
|
|
|
|
| 17 |
|
| 18 |
# --- Step 1: Scrape Events and Fights ---
|
| 19 |
print("\n--- Starting Events and Fights Scraping ---")
|
| 20 |
+
all_events_data = scrape_all_events()
|
| 21 |
+
with open(config.EVENTS_JSON_PATH, 'w') as f:
|
| 22 |
+
json.dump(all_events_data, f, indent=4)
|
| 23 |
print(f"Scraping for events complete. Data saved to {config.EVENTS_JSON_PATH}")
|
| 24 |
|
| 25 |
# --- Step 2: Scrape Fighters ---
|
| 26 |
print("\n--- Starting Fighters Scraping ---")
|
| 27 |
+
all_fighters_data = scrape_all_fighters()
|
| 28 |
+
with open(config.FIGHTERS_JSON_PATH, 'w') as f:
|
| 29 |
+
json.dump(all_fighters_data, f, indent=4)
|
| 30 |
print(f"Scraping for fighters complete. Data saved to {config.FIGHTERS_JSON_PATH}")
|
| 31 |
|
| 32 |
# --- Step 3: Convert JSON to CSV ---
|