NanmiCoder / NanmiCoder/MediaCrawler

[问题] 知乎基于问题的搜索

Open
#796 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
65.3k
Forks
12.6k
PR merge metrics
No merged PRs in 30d

Description

⚠️ 提交前确认

  • 我已经仔细阅读了项目使用过程中的常见问题汇总
  • 我已经搜索并查看了已关闭的issues
  • 我确认这不是由于滑块验证码、Cookie过期、Cookie提取错误、平台风控等常见原因导致的问题

❓ 问题描述

目前知乎似乎还没有基于问题,爬取问题下所有答案的功能。

zhihu_config.py

# 指定知乎用户URL列表
ZHIHU_CREATOR_URL_LIST = [
    "https://www.zhihu.com/people/yd1234567",
    # ........................
]

# 指定知乎ID列表
ZHIHU_SPECIFIED_ID_LIST = [
    "https://www.zhihu.com/question/826896610/answer/4885821440",  # 回答
    "https://zhuanlan.zhihu.com/p/673461588",  # 文章
    "https://www.zhihu.com/zvideo/1539542068422144000",  # 视频
]

这里只有回答的选项https://www.zhihu.com/question/826896610/answer/4885821440
没有问题的选项https://www.zhihu.com/question/826896610
如果将代码改成

ZHIHU_SPECIFIED_ID_LIST = [
    "https://www.zhihu.com/question/826896610"  # 问题
]

得不到任何结果。

请问能否增加基于问题的爬取功能,个人拙见认为基于问题下的回答进行分析研究是比较常见的需求,希望能得到认可。

🔍 使用场景

  • 目标平台: 知乎
  • 使用功能: 问题页面爬取

💻 环境信息

  • 操作系统: MacOS
  • Python版本: 3.12.12
  • 是否使用IP代理: 无
  • 是否使用VPN翻墙软件:无
  • 目标平台(抖音/小红书/微博等): 知乎

📋 错误日志

📷 错误截图

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with zhihu_config.py and trace how ZHIHU_SPECIFIED_ID_LIST entries are handled for answer URLs. Define the question URL behavior so it retrieves the answers under that question, then verify that https://www.zhihu.com/question/826896610 produces crawl results; no error log or test file is provided.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-engineering
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.