非 API。通过用户名、标签爬取帖子(照片、点赞、评论、日期等)
./driver/chromedriverpip install -r requirements.txt结果:位于 ./data 文件夹下
从用户名 "instagram" 下载前 10 张照片及信息
$ python3 crawl.py -q 'instagram' -n 10
从标签 #hello, #hi 下载前 7 张照片及信息(全部评论)
$ python3 crawl.py -q '#hello, #hi' --a -n 7
likes:
5,326
comments:
923
caption:
Art of @kendricklamar by @illestration Bold, bright and colorful.
commentMessages:
tttt: Amazing 😉
this_is_t.rs: my name says it all
dateTime:
2018-05-30T19:42:03.000Z
Usage:
crawl.py [-q QUERY] [-n NUMBER] [--a] [-h HELP]
Options:
-q QUERY 用户名,添加 '#' 搜索标签,例如 'username' 或 '#hashtag'
多个查询用逗号分隔,例如 'username1, username2, #hashtag'
-n NUM 返回的帖子数量 [默认值: 10000]
--a 收集所有评论
-h HELP 显示此帮助信息并退出
这是一个开源项目,欢迎通过以下方式参与: