c-x-a

1.接口地址

 https://www.instagram.com/p/shortcode/?__a=1

 如何获取shortcode

比如说文章地址是https://www.instagram.com/p/BhxqnqtH9Ws/?taken-by=lanlan521425

那么其shortcode就是BhxqnqtH9Ws

所以上述url对应的json链接就是

 https://www.instagram.com/p/BhxqnqtH9Ws/?__a=1

2.获取json然后命名jsonstr

然后用下面的解析方式获取当前Instagram的内容图片,经分析存在三种格式具体的自己按需选择,640,750,和1080

 

content_json = jsonstr.get("graphql").get("shortcode_media").get("edge_sidecar_to_children").get("edges")
for item in content_json:
   info_node = item.get("node").get("display_resources")

   print(info_node[2].get("src"))

  

分类:

技术点:

相关文章:

  • 2021-11-04
  • 2021-11-22
  • 2021-09-14
  • 2021-12-15
  • 2021-11-21
  • 2021-09-01
  • 2021-09-08
  • 2021-11-06
猜你喜欢
  • 2021-12-23
  • 2022-01-02
  • 2021-12-23
  • 2022-01-02
  • 2021-10-18
相关资源
相似解决方案