scraper.py 오류 수정

This commit is contained in:
2026-01-26 03:48:51 +09:00
parent 3d0dd24f27
commit dce6b3e692

View File

@@ -139,15 +139,14 @@ def fetch_overseas_news() -> List[Dict[str, str]]:
print(f"[StockLab] Overseas news failed: {e}")
return []
except Exception as e:
print(f"[StockLab] Scraping failed: {e}")
return []
def fetch_major_indices() -> Dict[str, Any]:
"""
KOSPI, KOSDAQ, KOSPI200 등 주요 지표 (네이버 금융 홈)
"""
url = "https://finance.naver.com/"
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)"
}
try:
targets = [
{"key": "KOSPI", "selector": ".kospi_area", "url": "https://finance.naver.com/"},