Giter Club home page Giter Club logo

Comments (6)

luanshils avatar luanshils commented on July 24, 2024

我看了下想要保存的评论,是一级评论,但是就是没下载到

from mediacrawler.

NanmiCoder avatar NanmiCoder commented on July 24, 2024

默认是保存一级评论的,爬去一个帖子的所有评论在代码里也有的,改一下就 OK 了,这个函数签名中有标志位,可选择开启小红书的所有评论爬去,

async def get_note_all_comments(self, note_id: str, crawl_interval: float = 1.0, is_fetch_sub_comments=False):
"""
get note all comments include sub comments
:param note_id:
:param crawl_interval:
:param is_fetch_sub_comments:
:return:
"""
result = []

from mediacrawler.

luanshils avatar luanshils commented on July 24, 2024

默认是保存一级评论的,爬去一个帖子的所有评论在代码里也有的,改一下就 OK 了,这个函数签名中有标志位,可选择开启小红书的所有评论爬去,

async def get_note_all_comments(self, note_id: str, crawl_interval: float = 1.0, is_fetch_sub_comments=False):
"""
get note all comments include sub comments
:param note_id:
:param crawl_interval:
:param is_fetch_sub_comments:
:return:
"""
result = []

感谢大佬的回复,对于评论,我再好好研读一下代码。然后,其实我现在没弄明白的是怎么单独在单一的用户 下的笔记进行爬取所有笔记。我看大佬写的都是根据关键词检索出的相关笔记。

from mediacrawler.

NanmiCoder avatar NanmiCoder commented on July 24, 2024

默认是保存一级评论的,爬去一个帖子的所有评论在代码里也有的,改一下就 OK 了,这个函数签名中有标志位,可选择开启小红书的所有评论爬去,

async def get_note_all_comments(self, note_id: str, crawl_interval: float = 1.0, is_fetch_sub_comments=False):
"""
get note all comments include sub comments
:param note_id:
:param crawl_interval:
:param is_fetch_sub_comments:
:return:
"""
result = []

感谢大佬的回复,对于评论,我再好好研读一下代码。然后,其实我现在没弄明白的是怎么单独在单一的用户 下的笔记进行爬取所有笔记。我看大佬写的都是根据关键词检索出的相关笔记。

在 xhs web 端可以轻松抓包得到一个用户下的笔记的 http 请求,改改代码就可以了,函数的 sign 签名都是一样的套路

from mediacrawler.

luanshils avatar luanshils commented on July 24, 2024

默认是保存一级评论的,爬去一个帖子的所有评论在代码里也有的,改一下就 OK 了,这个函数签名中有标志位,可选择开启小红书的所有评论爬去,

async def get_note_all_comments(self, note_id: str, crawl_interval: float = 1.0, is_fetch_sub_comments=False):
"""
get note all comments include sub comments
:param note_id:
:param crawl_interval:
:param is_fetch_sub_comments:
:return:
"""
result = []

感谢大佬的回复,对于评论,我再好好研读一下代码。然后,其实我现在没弄明白的是怎么单独在单一的用户 下的笔记进行爬取所有笔记。我看大佬写的都是根据关键词检索出的相关笔记。

在 xhs web 端可以轻松抓包得到一个用户下的笔记的 http 请求,改改代码就可以了,函数的 sign 签名都是一样的套路

好的大佬

from mediacrawler.

flyysquirrel avatar flyysquirrel commented on July 24, 2024

能从用户 id 获得所有帖子吗?
在网页端似乎只能拿到前几条帖子

from mediacrawler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.