
How to Download an Instagram Profile Picture using Python | Python Instagram | Instagram Python
*Video Link:-
https://youtu.be/TTSyOspexD4
*Details:-
In this tutorial, we will learn how to download profile picture of any Instagram profile in our computer system without log in or password using BeautifulSoup in Python.
* Functions:-
1. import all necessary packages
2. Input Instagram account username
3. Set the web address of Instagram profile
4. By using urllib, Send this web address as an http request to Instagram server and server will return the raw data of Instagram profile. Save these data in a variable.
5. By using BeautifulSoup we will search the url of profile picture.
6. By using requests library, we will get the raw binary data of profile picture.
7. Create a binary image file in write mode.
8. Write all binary data into this binary file.
9. Save binay file as a .jpg image.
10. Close file.
* Library Packages:- urllib, bs4(BeautifulSoup), requests
*Coding:-
import requests
from urllib.request import urlopen
from bs4 import BeautifulSoup
url="https://www.instagram.com/{}/"
username=input('enter username=')
webadd=url.format(username)
html=BeautifulSoup(webadd, 'html.parser')
data=html.find('meta', property=:'og:image:')
If you want to learn rest coding then you can watch our YouTube video...
*Hashtags:-
#coding #programming #python #instagram #scraping #automation #tutorial #learning #online