import requests
from bs4 import BeautifulSoup

URL="https://www.instagram.com/{}/"

def scrape(username):
    full_url=URL.format(username) #making url full concat with URL
    r=requests.get(full_url)
    s=BeautifulSoup(r.text,'html.parser')

    tag=s.find("meta", attrs={"name" : "description"})
    text=tag.attrs['content']
    main_text=text.split("-")[0]

    return main_text

USERNAME="tusharchamoli_15"
data = scrape(USERNAME)
print(data)

52755154bac25eb100e8e6e3e3c8904c86518572
<mask token>


def scrape(username):
    full_url = URL.format(username)
    r = requests.get(full_url)
    s = BeautifulSoup(r.text, 'html.parser')
    tag = s.find('meta', attrs={'name': 'description'})
    text = tag.attrs['content']
    main_text = text.split('-')[0]
    return main_text


<mask token>

<mask token>


def scrape(username):
    full_url = URL.format(username)
    r = requests.get(full_url)
    s = BeautifulSoup(r.text, 'html.parser')
    tag = s.find('meta', attrs={'name': 'description'})
    text = tag.attrs['content']
    main_text = text.split('-')[0]
    return main_text


<mask token>
print(data)

<mask token>
URL = 'https://www.instagram.com/{}/'


def scrape(username):
    full_url = URL.format(username)
    r = requests.get(full_url)
    s = BeautifulSoup(r.text, 'html.parser')
    tag = s.find('meta', attrs={'name': 'description'})
    text = tag.attrs['content']
    main_text = text.split('-')[0]
    return main_text


USERNAME = 'tusharchamoli_15'
data = scrape(USERNAME)
print(data)

import requests
from bs4 import BeautifulSoup
URL = 'https://www.instagram.com/{}/'


def scrape(username):
    full_url = URL.format(username)
    r = requests.get(full_url)
    s = BeautifulSoup(r.text, 'html.parser')
    tag = s.find('meta', attrs={'name': 'description'})
    text = tag.attrs['content']
    main_text = text.split('-')[0]
    return main_text


USERNAME = 'tusharchamoli_15'
data = scrape(USERNAME)
print(data)

import requests
from bs4 import BeautifulSoup

URL="https://www.instagram.com/{}/"

def scrape(username):
    full_url=URL.format(username) #making url full concat with URL
    r=requests.get(full_url)
    s=BeautifulSoup(r.text,'html.parser')

    tag=s.find("meta", attrs={"name" : "description"})
    text=tag.attrs['content']
    main_text=text.split("-")[0]

    return main_text

USERNAME="tusharchamoli_15"
data = scrape(USERNAME)
print(data)
