Social::Instagram::Profile - Instagram 爬虫工具。从 Instagram 个人资料中采集数据

爬虫工具概览
Social::Instagram::Profile – 抓取 Instagram 个人资料数据。Instagram 爬虫工具支持批量抓取用户个人资料数据。采集的数据包括昵称、姓名、个人简介、网站、帖子数量等。完整的数据采集列表请参阅相应章节。A-Parser 的功能允许保存 Social::Instagram::Profile 爬虫工具的设置以供日后使用(预设),设置数据抓取计划等等。
得益于内置强大的 Template Toolkit 模板引擎,可以按您需要的形式和结构保存结果,该引擎允许对结果应用额外逻辑并以各种格式输出数据,包括 JSON、SQL 和 CSV。
备注
该爬虫工具使用已登录账号的数据。 要使爬虫工具正常工作,必须为 cookie 选项指定值。
爬虫工具应用案例
采集帖子链接

- 覆盖 Result format 选项,将值设为
$posts.format('$link\n')。 - 覆盖 Posts pages count 选项,在列表中选择
All。 - 在查询中指定个人资料链接。
下载示例
eJx9U01v2zAM/SuBkMMGBEF72MUYBqTBArTI6qxpT0EOhEVnamRRk+RsneH/Pkpx
7CT78Mn8eI98ItmIAH7vVw49Bi+yTSNs+heZkFhCrYOYCAvOo4vhjVhToUBn2b3x
AXYOqixbOSqVRk7sIY0IbxaZhA7onJIxqCTbBdFeResAuo4JH+fJ40dUjsCMoA7f
yKlfKEdQFFSb8Em0/6az5INfwQ7nMXWgvb3hr91uJ4LVcEd+Qa6CqGpsb6edxD64
hgM+Ewc7GScMW49QxbpjCQFjdFomonfvp+FnZAApVVBkQB8rxEcaqr4Y9T2pNMS5
/OtY6cJRxa6AiSA6307dbcQ42YIp6oT9esSIrATtcSI8t7oAbkReR1RAB4FcbmM/
7G8EmZnWSzygHtIS/12ttOSJzkoG3XfAv6fkf3C0vbzzUjyYH4576FmSdZd/GVCS
lrQ7PYZWlQps++PkMnHDzj2i7d/sMaZV5LAv0zF31XlpLZq4BcPIZnZwXci4GMul
syBTql3ebdYpszbPfBm5mVNlNUZdptaax+LxaViPme/GEI2hwWvwPJW4uKlApP3D
+tiqdYrX70NssOKXPK/aURag9cvT8jwSgT6Qzc1n567GlxZDFE75oCC9d8ELvCNe
LZbXbvub7i+/+d9lZ03L83vlS0ugKDZC2Mev5nk4fHHtb+bPg/A=
采集的数据
- 昵称
- 全名
- 个人简介
- 网站
- 帖子数量
- 粉丝数量
- 关注数量
- 作者资料链接
- 频道
- 是否为商业账户
- 是否为私密账户
- 是否为认证账户
- 头像链接
- Facebook 页面链接
- 帖子信息
- 视频观看次数
- 个人资料邮箱
- 个人资料位置
- 电话号码(来自个人简介)
- 作者发布的帖子
- 类型
- 链接
- 文本
- 时间
- 评论数
- 点赞数
- 媒体链接
- 发布高度
- 发布宽度
- 发布作者链接
- 位置
- 观看次数(视频)
- 关注者和粉丝
- 标识符
- 个人资料链接
- 昵称
- 全名
- 是否为私密账户
- 是否为认证账户
- 头像链接
- 用户是否为潜在欺诈者
- 附加链接
- 标题
- 链接
- 类型
使用场景
- 采集个人资料信息
- 采集发布的帖子
- 采集粉丝
- 采集关注
- 抓取帖子链接,以便在
Social::Instagram::Post 中使用
设置
获取授权所需的必要选项
提示:如何找到 cookie?
先打开 F12 调试模式,然后访问任何个人资料页面。
通过字符串 graphql/query(json 类型)查找所需的请求,其中包含爬虫工具所需的值。
点击该请求并从 cookie 参数中复制值。

查询
查询时需要指定个人资料昵称,例如:
cristiano
kyliejenner
结果输出示例
得益于内置的模板引擎 Template Toolkit,A-Parser 支持灵活的结果格式化,允许以任意形式以及结构化形式(如 CSV 或 JSON)输出结果。
默认输出
结果格式:
$query: $full_name, followers: $followers_count, following: $following_count\nPosts:\n$posts.format('$link\n')
结果示例:
cristiano: Cristiano Ronaldo, followers: 579975336, following: 558
Posts:
https://www.instagram.com/p/CrmIE7tNddZ/
https://www.instagram.com/p/Crg1arRNXvX/
https://www.instagram.com/p/CrUE3a6tRs4/
https://www.instagram.com/p/CrK_zvLAofv/
https://www.instagram.com/p/CrGMggNq1Cb/
https://www.instagram.com/p/CrEHoMbK0_C/
https://www.instagram.com/p/Cq8QZGDIix1/
https://www.instagram.com/p/CqxINLiOCPK/
https://www.instagram.com/p/CqoZ8pRo91y/
https://www.instagram.com/p/CqjQjCII98k/
https://www.instagram.com/p/CqeFZMFotaH/
https://www.instagram.com/p/CqcihSbAxaH/
关注和粉丝的个人资料链接
结果格式:
Followers:\n$followers.format('$link\n')\nFollowings:\n$followings.format('$link\n')
结果示例:
Followers:
https://www.instagram.com/madhu55745/
https://www.instagram.com/akoy4615/
https://www.instagram.com/kiiitank/
https://www.instagram.com/erzhi19/
https://www.instagram.com/na898poli/
https://www.instagram.com/omronnmaaj/
https://www.instagram.com/abhishak8474/
https://www.instagram.com/karankumarkaran110/
https://www.instagram.com/engin_altannnn/
https://www.instagram.com/biel.full/
Followings:
https://www.instagram.com/rafanery.hrpz/
https://www.instagram.com/hubermanlab/
https://www.instagram.com/insparya_italy/
https://www.instagram.com/gerson_rodrigues_11/
https://www.instagram.com/bernardorsousa/
https://www.instagram.com/eminem/
https://www.instagram.com/spl/
https://www.instagram.com/toto.restaurants/
https://www.instagram.com/thetoolsbook/
https://www.instagram.com/rauwalejandro/
https://www.instagram.com/francisngannou/
https://www.instagram.com/sultan_alghannam/
可用设置
| 参数 | 默认值 | 描述 |
|---|---|---|
| cookie | 必须预先指定 Cookie | |
| x-csrftoken | 可以指定 x-csrftoken(如有必要) | |
| x-ig-app-id | 936619743392459 | 可以指定 x-ig-app-id(如有必要) |
| Posts pages count | 1 | 帖子页数 |
| Followers pages count | 1 | 粉丝页数 |
| Followings pages count | 1 | 关注页数 |