Scraping on instagram

Asked

Viewed 57 times

1

Hello, I would like to ask for a help, I’m wanting to do a scraping on Instagram to be able to analyze personas and extract some data as tags most used by people who follow a certain someone, I took an x profile with some followers and managed to extract some information.

The idea is, to be able to take information as tags used by people who follow a particular profile so that they can identify what they like and plot a persona analysis, could someone please help me? below the code I made up to the moment.

from urllib.error import URLError,HTTPError

url = 'https://www.instagram.com/martinhagondimoficial/followers/?hl=pt-br'

headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36'}
try:
    req = Request(url, headers = headers)
    response = urlopen(req)
    print(response.read())

except HTTPError as e:
    print(e.status, e.reason)
    
except HTTPError as e:
    print(e.reason)
  • 1

    Only thing you’ve done so far is get an HTML page. Now you need to operate on top of this html.

  • in case I have to format to string in order to handle the data ?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.