instagram-scraper: A Python Tool for Downloading Instagram Images and Videos

Tadashi Shigeoka ·  Sat, September 1, 2018

I’ll introduce instagram-scraper, a Python tool that scrapes Instagram and downloads images and videos.

Instagram | インスタグラム

Installing instagram-scraper

First, install instagram-scraper.

pip install instagram-scraper

How to Use instagram-scraper

Execute the instagram-scraper command by specifying your Instagram account username and password with the —login_user and —login_pass options.

Scraping a Specific Username

instagram_login_user='your_user' # Your username
instagram_login_pass='your_password' # Your password

target_username='scraping_target_username' # Username to scrape

instagram-scraper \\
$target_username \\
--login_user $instagram_login_user \\
--login_pass $instagram_login_pass

Scraping a Specific Tag

instagram_login_user='your_user' # Your username
instagram_login_pass='your_password' # Your password

# Tag to scrape
# https://www.instagram.com/explore/tags/javascriptlover/
target_tag='javascriptlover'

instagram-scraper \\
--login_user $instagram_login_user \\
--login_pass $instagram_login_pass \\
--tag $target_tag

That’s all about scraping Instagram images and videos with instagram-scraper from the Gemba.