Computer Coding Class
1 min readDec 27, 2023

--

How to scrape instagram profile picture using python

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

Computer Coding Class

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Computer Coding Class
Computer Coding Class

Written by Computer Coding Class

It is a YouTube Channel to learn Computer Coding and Programming in different famous Programming languages like C++, Python, Java from scratch to advanced leveI

No responses yet

Write a response