Hello, so i tried to make my own insta crawler but having some dificulties, here is the code for now:
import requests
from bs4 import BeautifulSoup
def insta_spider(max_pages):
page = 1
while page <= max_pages:
url = 'https://instagram.com/xenia/'
source_code = requests.get(url)
plain_text = source_code.text
soup = BeautifulSoup(plain_text, "html.parser")
for link in soup.findAll('a', {'class': '_2g7d5 notranslate _7qk7w'}):
href = "https://instagram.com/" + link.get('href')
title = link.string
print(href)
print(title)
#get_single_item_data(title)
page += 1
insta_spider(1)
so basicly i want to get the href
tags with the class name _2g7d5 notranslate _7qk7w
of the current instagram profile which is https://instagram.com/xenia/
but i get nothing gathered Process finished with exit code 0
. Someone knows whats the problem with this code or instagram does not allow to crawl?
EDIT: Somehow instagram doesnt display the classes i want to gather in the View Source
page how do i solve this?