Ahmedik95316 commited on
Commit
2f16dd4
·
1 Parent(s): 59c71e7

Update data/scrape_real_news.py

Browse files

Fixed the file paths to correctly point to `tmp` folder as the original paths are read-only

Files changed (1) hide show
  1. data/scrape_real_news.py +12 -3
data/scrape_real_news.py CHANGED
@@ -3,10 +3,19 @@ from pathlib import Path
3
  import pandas as pd
4
  import datetime
5
 
6
- # Output path
7
- BASE_DIR = Path(__file__).resolve().parent
8
  # OUTPUT_PATH = BASE_DIR / "scraped_real.csv"
9
- OUTPUT_PATH = Path("/tmp/scraped_real.csv")
 
 
 
 
 
 
 
 
 
10
 
11
  # News sources
12
  NEWS_SITES = [
 
3
  import pandas as pd
4
  import datetime
5
 
6
+ # # Output path
7
+ # BASE_DIR = Path(__file__).resolve().parent
8
  # OUTPUT_PATH = BASE_DIR / "scraped_real.csv"
9
+
10
+ # Use /tmp for writable storage
11
+ BASE_DIR = Path("/tmp")
12
+
13
+ # Ensure data directory exists
14
+ DATA_DIR = BASE_DIR / "data"
15
+ DATA_DIR.mkdir(parents=True, exist_ok=True)
16
+
17
+ # Final output path
18
+ OUTPUT_PATH = DATA_DIR / "scraped_real.csv"
19
 
20
  # News sources
21
  NEWS_SITES = [