From 7f90ae442e72f65638596d11dec97f2f15cb210e Mon Sep 17 00:00:00 2001 From: Psychiquest <37347900+Psychiquest@users.noreply.github.com> Date: Wed, 3 Oct 2018 01:35:01 +0530 Subject: [PATCH] Create dppage.py --- InstadpShower/dppage.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 InstadpShower/dppage.py diff --git a/InstadpShower/dppage.py b/InstadpShower/dppage.py new file mode 100644 index 0000000..2464a95 --- /dev/null +++ b/InstadpShower/dppage.py @@ -0,0 +1,24 @@ +from bs4 import BeautifulSoup +import requests +import webbrowser as wb + + +username = input("Enter the instagram user-id: ") + +try: + a = requests.get("https://www.instagram.com/"+username) + co = a.content + soup = BeautifulSoup(co,'html.parser') + link = soup.find_all('meta' , property="og:image") + print(link) + print(type(soup)) + + imagelink=(str(link[0])[15:]) + imagelink=imagelink[:len(imagelink)-23] + print(imagelink) + wb.open_new_tab(imagelink) + +except : + print("No such username exists") + +