|
|
@@ -34,15 +34,13 @@ class SearchManager:
|
|
|
html_path = self.save_page(keyword, start)
|
|
|
|
|
|
# 保存到数据库
|
|
|
- restult = self.db_manager.save_search_result(
|
|
|
+ return self.db_manager.save_search_result(
|
|
|
keyword=keyword,
|
|
|
start=start,
|
|
|
url=url,
|
|
|
html_path=str(html_path)
|
|
|
)
|
|
|
|
|
|
- return html_path
|
|
|
-
|
|
|
async def next_page(self, keyword: str, current_start: int) -> list[str]:
|
|
|
"""翻到下一页并返回结果链接
|
|
|
|
|
|
@@ -63,8 +61,6 @@ class SearchManager:
|
|
|
|
|
|
save_path = save_dir / f"{start}.html"
|
|
|
save_to_file(self.page.html, save_path)
|
|
|
-
|
|
|
- # 保存到数据库
|
|
|
return save_path
|
|
|
|
|
|
async def _process_page(self, url: str) -> CrawlResult:
|