-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscrape.py
More file actions
executable file
·46 lines (36 loc) · 1.45 KB
/
Copy pathscrape.py
File metadata and controls
executable file
·46 lines (36 loc) · 1.45 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env python3
"""
Apple Documentation Scraper - Main Entry Point
This is the primary script for scraping Apple's developer documentation.
It provides a clean interface to the comprehensive scraping system.
Usage:
python3 scrape.py # Interactive mode with prompts
python3 scrape.py --all --yes # Scrape all frameworks without prompts
python3 scrape.py --frameworks SwiftUI UIKit --yes # Specific frameworks
python3 scrape.py --dry-run # Preview what would be scraped
Examples:
# Scrape all 342+ frameworks (production run):
python3 scrape.py --all --yes
# Scrape specific frameworks:
python3 scrape.py --frameworks SwiftUI UIKit Foundation --yes
# Resume interrupted scraping:
python3 scrape.py --resume --yes
"""
import sys
import os
# Add scripts directory to path so we can import utilities
scripts_dir = os.path.join(os.path.dirname(__file__), 'scripts', 'utilities')
sys.path.insert(0, scripts_dir)
try:
from scrape_all_frameworks import scrape_everything
import asyncio
if __name__ == "__main__":
# Simply delegate to the main scraper
asyncio.run(scrape_everything())
except ImportError as e:
print(f"❌ Error importing scraper module: {e}")
print("💡 Make sure all dependencies are installed: pip install -r requirements.txt")
sys.exit(1)
except Exception as e:
print(f"❌ Error running scraper: {e}")
sys.exit(1)