How to Extract Instagram Data

前端 未结 4 539
傲寒
傲寒 2021-02-01 11:12

I\'m attempting to construct a Microsoft Access database of Instagram accounts, and want to extract the following data, among other things:

  • Account name
  • N
4条回答
  •  猫巷女王i
    2021-02-01 11:38

    Well if this question has 'web-Scraping' keyword then allow me to share some information here..

    Instagram has a JavaScript JSON data in their html source while display the user's information by link, like https://www.instagram.com/user-account/. You can parse these data by any scripting language and can get JSON data.

    Instagram shows only 10 Posts once in Single Request, You can see the user's Basic information like user name, biography, no of posts, no of followers and following. But, if we need all likes and comments and all images or likes and comments for each and every photo post. Then we have to click their 'Load more' button.

    Load More request a Ajax Call include '?max_id' which gives you next 10 posts information. So you have to create a Post loop to Send/Get rest information until 'max_id' empty or null.

    Example Request: First page, https://www.instagram.com/demo-user/

    Next Data Request: https://www.instagram.com/demo-user/?max_id=1533276522

    and so on...

    Recently I had some spare time and I was angry on Instagram ;) So just made a Script to solve all theses problems. This works on PHP and code are well commented, so I don't think this cause any issue to understand the application flow. You can see the script, how it works & can use logic with any other language.

    This comes from this GitHub Repository Code

    &.. Yes, it doesn't required Instagram API or else.. :)

提交回复
热议问题