INNER CODE UNIT · Python

_load_config

zillionare/zillionare · scripts/enhanced_news_crawler.py:102

    def _load_config(self) -> Dict:
        """加载配置文件"""
        try:
            with open(self.config_path, "r", encoding="utf-8") as f:
                return yaml.safe_load(f)
        except Exception as e:
            logger.error(f"Failed to load config: {e}")
            return {}

    def _setup_session(self):
        """设置请求会话"""
        headers = self.config.get("crawler_config", {}).get("headers", {})
        self.session.headers.update(headers)

        timeout = self.config.get("crawler_config", {}).get("timeout", 30)
        self.session.timeout = timeout

    def fetch_rss_feeds(self) -> List[NewsArticle]:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…