f41e75a1b2
- Add COMMENT_API_TEMPLATE for comment API URL - Implement crawl_comments() returning CommentsResult - Use order=hot for popular comments sorting - Only fetch first-level comments (no nested replies) - Add include_comments parameter to crawl_answer() - Export CommentAuthor, CommentData, CommentsResult in __init__.py Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
40 lines
767 B
Python
40 lines
767 B
Python
"""Zhihu Crawler Module
|
|
|
|
Provides content crawling capabilities for Zhihu using Playwright API interception.
|
|
"""
|
|
|
|
from .models import (
|
|
AuthorInfo,
|
|
ContentMetadata,
|
|
AnswerData,
|
|
ArticleData,
|
|
CommentAuthor,
|
|
CommentData,
|
|
CommentsResult,
|
|
CrawlResult,
|
|
)
|
|
from .config import (
|
|
ProxyConfig,
|
|
CrawlerConfig,
|
|
get_crawler_config,
|
|
reset_crawler_config,
|
|
)
|
|
from .zhihu_crawler import ZhihuCrawler, ZhihuApiInterceptor
|
|
|
|
__all__ = [
|
|
"AuthorInfo",
|
|
"ContentMetadata",
|
|
"AnswerData",
|
|
"ArticleData",
|
|
"CommentAuthor",
|
|
"CommentData",
|
|
"CommentsResult",
|
|
"CrawlResult",
|
|
"ProxyConfig",
|
|
"CrawlerConfig",
|
|
"get_crawler_config",
|
|
"reset_crawler_config",
|
|
"ZhihuCrawler",
|
|
"ZhihuApiInterceptor",
|
|
]
|