diff --git a/src/Instagram Scrapping.py b/src/Instagram Scrapping.py new file mode 100644 index 0000000..1234ee3 --- /dev/null +++ b/src/Instagram Scrapping.py @@ -0,0 +1,22 @@ +# INSTAGRAM SCRAPPING +import requests +from bs4 import BeautifulSoup + +URL = "http://www.instagram.com/{}/" + +def scrape(username): + full_url = URL.format(username) + r = requests.get(full_url) + s = BeautifulSoup(r.text,"lxml") + + tag = s.find("meta",attrs = {"name":"description"}) + text = tag.attrs['content'] + main_text = text.split("-")[0] + + + return main_text + + +USERNAME = input("Enter the Username") +data = scrape(USERNAME) +print(data)