Git Product home page Git Product logo

xhsaaa's Introduction

xhs 半自动爬虫(施工中...)

功能

  1. 获取指定用户所有笔记(图片、视频)
  2. 获取收藏列表所有笔记(自己的收藏或者他人公开的收藏)

工具

  1. 安卓手机或安卓模拟器(都需要 root,且已安装 xhs 应用)
  2. 一台电脑
  3. fiddler 抓包工具

开始使用

  1. 导入 fiddler 证书到安卓系统中,见本文

  2. 打开 fiddler 的 filter 功能,过滤如下 url: https://edith.xiaohongshu.com/api/sns/v1/note/faved

    fiddlerconfig

  3. 打开 xhs 应用,登陆,找到要获取的用户或是收藏列表,不停滑动(没错,这就是这个项目叫半自动的原因),直到所有笔记都加载完

  4. 使用 fiddler 的 decode 功能将抓到的包解码成明文 json,然后导出所有 json 响应到自定义的目录中。

  5. 运行 python3 run.py

注意事项

  1. 当前只能爬取图片类笔记的首张图片,因为 api 不支持多张图片(要做的话只能一个一个笔记爬取,因为我没有爬取全部图片的需求,懒得做了)
  2. xhs 的 FHD 视频(1080P 以上)仅能在北京时间早上 9 点前爬取,之后就只有 HD 视频了。
  3. 由于近期 xhs 的设备登陆限制更加严格,所以建议使用实体安卓手机(无需 sim 卡)而不是模拟器。
  4. 本爬虫使用代理抓包方式,无封号风险,本人已正常使用半年。如有疑虑,建议开小号。
  5. 由于 xhs 没有公开 api 文档,所以现在仅能实现半自动爬取,使用时需要一定的计算机基础。

xhsaaa's People

Contributors

prophethjk avatar

Watchers

 avatar

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.