m
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
import sys
|
||||
import os
|
||||
import time
|
||||
|
||||
# Add current dir to path to import scraping scripts
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
try:
|
||||
import scrape_newbt
|
||||
import scrape_cbtbank
|
||||
except ImportError as e:
|
||||
print(f"Failed to import scraping modules: {e}")
|
||||
sys.exit(1)
|
||||
|
||||
# Configuration
|
||||
db_file = r"./qple_quiz.db"
|
||||
assets_dir = r"./assets"
|
||||
delay = 0.1 # Moderate delay to prevent server blocking but process fast
|
||||
|
||||
print("======================================================================")
|
||||
print(">>> STARTING REQUESTED EXAMS SCRAPING PIPELINE")
|
||||
print("======================================================================")
|
||||
|
||||
# 1. Scrape '무역영어 1급' from newbt.kr
|
||||
print("\n>>> [PART 1/2] Scraping '무역영어 1급' from newbt.kr...")
|
||||
try:
|
||||
scrape_newbt.scrape_exam(
|
||||
exam_name="무역영어 1급",
|
||||
selected_rounds=None,
|
||||
overwrite=False,
|
||||
delay=delay,
|
||||
db_file=db_file,
|
||||
assets_dir=assets_dir
|
||||
)
|
||||
except Exception as e:
|
||||
print(f"[Error] Failed scraping '무역영어 1급' from newbt: {e}")
|
||||
|
||||
time.sleep(1.0)
|
||||
|
||||
# 2. Scrape '건축기사' from cbtbank.kr
|
||||
print("\n>>> [PART 2/2] Scraping '건축기사' from cbtbank.kr...")
|
||||
try:
|
||||
scrape_cbtbank.scrape_exam(
|
||||
exam_name="건축기사",
|
||||
selected_rounds=None,
|
||||
overwrite=False,
|
||||
delay=delay,
|
||||
db_file=db_file,
|
||||
assets_dir=assets_dir
|
||||
)
|
||||
except Exception as e:
|
||||
print(f"[Error] Failed scraping '건축기사' from cbtbank: {e}")
|
||||
|
||||
print("\n======================================================================")
|
||||
print(">>> ALL REQUESTED SCRAPING TASKS COMPLETE!")
|
||||
print("======================================================================")
|
||||
Reference in New Issue
Block a user