DEV Community

loading...
Cover image for Scraping Instagram reels with instascrape

Scraping Instagram reels with instascrape

chrisgreening profile image Chris Greening ・1 min read
from instascrape import Reel
Enter fullscreen mode Exit fullscreen mode

In this blog post, I'm going to show you how to scrape Instagram reels using the Python library instascrape's latest feature!

Introducing the Reel scraper

With the release of v1.5.0, instascrape now provides the Reel object for scraping Instagram reel's in just a few lines of code:

from instascrape import Reel 
google_reel = Reel('https://www.instagram.com/reel/CIrJSrFFHM_/')
google_reel.scrape()
print(f"This reel has {google_reel.video_view_count:,} views.")
>>> This reel has 48,593 views.
Enter fullscreen mode Exit fullscreen mode

And that's it! Reel is a subclass of the Post scraper so all expected behaviors and methods carry down for easy usage.

Additional instascrape content

If you're interested in seeing some more instascrape content, check out some of my other blog posts

and drop by the official repo and introduce yourself!

GitHub logo chris-greening / instascrape

Powerful and flexible Instagram scraping library for Python, providing easy-to-use and expressive tools for accessing data programmatically

instascrape: powerful Instagram data scraping toolkit

Version Downloads Release License

Activity Dependencies Issues Code style: black

What is it?

instascrape is a lightweight Python package that provides expressive and flexible tools for scraping Instagram data. It is geared towards being a high-level building block on the data scientist's toolchain and can be seamlessly integrated and extended with industry standard tools for web scraping, data science, and analysis.

Key features

Here are a few of the things that instascrape does well:

  • Powerful, object-oriented scraping tools for profiles, posts, hashtags, reels, and IGTV
  • Scrapes HTML, BeautifulSoup, and JSON
  • Download content to your computer as png, jpg, mp4, and mp3
  • Dynamically retrieve HTML embed code for posts
  • Expressive and consistent API for concise and elegant code
  • Designed for seamless integration with Selenium, Pandas, and other industry standard tools for data collection and analysis
  • Lightweight; no boilerplate or configurations necessary
  • The only hard dependencies are Requests and Beautiful

Discussion (1)

pic
Editor guide
Collapse
anuragsinghal13 profile image
Anurag Singhal

Is there a way I can get the same data using a profile link ?