Instagram Scraper 2021 项目教程

Instagram Scraper 2021 项目教程

Instagram-Scraper-2021 Scrape Instagram content and stories, using a new technique based on the har file (No Token + No public API). Instagram-Scraper-2021 项目地址: https://gitcode.com/gh_mirrors/in/Instagram-Scraper-2021

1. 项目的目录结构及介绍

Instagram-Scraper-2021/
├── README.md
├── requirements.txt
├── scraper.py
├── config.json
└── utils/
    ├── __init__.py
    └── helpers.py
  • README.md: 项目的介绍文件,包含项目的基本信息和使用说明。
  • requirements.txt: 列出了项目运行所需的Python依赖包。
  • scraper.py: 项目的启动文件,包含了主要的爬虫逻辑。
  • config.json: 项目的配置文件,用于存储爬虫的配置参数。
  • utils/: 包含项目中使用的辅助函数和工具。
    • init.py: 使 utils 成为一个Python包。
    • helpers.py: 包含一些辅助函数,用于处理数据和执行其他任务。

2. 项目的启动文件介绍

scraper.py 是项目的启动文件,主要负责以下功能:

  • 导入依赖: 导入所需的Python库和模块。
  • 读取配置: 从 config.json 文件中读取配置参数。
  • 初始化爬虫: 根据配置参数初始化爬虫对象。
  • 执行爬取任务: 启动爬虫,执行数据爬取任务。
  • 保存结果: 将爬取的数据保存到指定的文件或数据库中。

3. 项目的配置文件介绍

config.json 是项目的配置文件,包含以下配置参数:

{
  "username": "your_instagram_username",
  "password": "your_instagram_password",
  "target_username": "target_instagram_username",
  "output_format": "csv",
  "output_path": "output/",
  "max_posts": 100
}
  • username: 你的Instagram账号用户名。
  • password: 你的Instagram账号密码。
  • target_username: 你想要爬取的目标Instagram账号用户名。
  • output_format: 输出数据的格式,例如 csvjson
  • output_path: 输出文件的保存路径。
  • max_posts: 最大爬取的帖子数量。

通过修改 config.json 文件中的参数,可以自定义爬虫的行为和输出结果。

Instagram-Scraper-2021 Scrape Instagram content and stories, using a new technique based on the har file (No Token + No public API). Instagram-Scraper-2021 项目地址: https://gitcode.com/gh_mirrors/in/Instagram-Scraper-2021

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

姬鸿桢

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值