microcyan/php-spider

PHP开发的辅助工具

1.0.0 2023-10-10 16:47 UTC

This package is not auto-updated.

Last update: 2025-03-31 09:59:31 UTC


README

首先登录小红书,再进行操作

Cookie

Alt 获取Cookie

代码

    $Cookie = '';
    //参数举例
    $noteId = "6518d251000000002101c53f";
    $checkCookie = true;
    $userId = "64be068b000000002b008e72";
    $cursor="";
    $top_comment_id="";
    //初始化
    $xhs = \MicroCyanSpider\Core\Spider::XiaoHongShu([]);
    //设置Cookie---必须
    $xhs->setCookie($Cookie);
    //设置代理--非必填
    $xhs->setProxy('user:password@ip:port');
    //获取笔记数据
    $xhs->getNote($noteId,$checkCookie);
    //获取作者信息
    $xhs->getUserProfile($userId,$checkCookie);
    //获取笔记评论信息
    $xhs->getComments($noteId,$cursor,$top_comment_id);