Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

luengwaiban/instagram-python-scraper

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

instagram-python-scraper

this repo is now merging with realsirjoe/instagram-scraper, get latest version at 👉 instagram-scraper 👈

A instagram scraper wrote in python.Get medias, account, videos, comments without authentication.Comment and like action also supported.
Similar to instagram-php-scraper. Enjoy it! ☺️
**Any star or contribution would be appreciated if it is helpful for you ~** 🙋‍♂️🌚

install

You can simply run this command:

pip install instagram-python-scraper

Or you can also download it directly and install the libs that recorded in require.txt first.
Run the command below:

pip install -r requirements.txt

usages

Some methods require authentication:

from instagram_scraper.instagram import InstagramScraper

instagram = InstagramScraper()

# authentication supported
instagram.with_credentials('your account', 'your password')
res = instagram.login()

followers = instagram.get_followers('206034174', 20, 20, True)
print(followers[0])

If you use authentication the program will cache the user session by default so that you don't need to gain session everytime.
But if you want to disable the user session cache, just assign True to login() method:

from instagram_scraper.instagram import InstagramScraper

instagram = InstagramScraper()

instagram.with_credentials('your account', 'your password')
res = instagram.login(True)

Besides, account verification is also supported by default. When a account verification is needed, you will receive a active code by email or something and you should then input the code in terminal to finish verification.

Many of the methods do not require authentication:

from instagram_scraper.instagram import InstagramScraper

instagram = InstagramScraper()

account = instagram.get_account('shaq')
account_id = account.get_id()
print(account._id)

Using proxy for requests:

from instagram_scraper.instagram import InstagramScraper

proxies = {
    'http': 'http://127.0.0.1:1087',
    'https': 'http://127.0.0.1:1087',
}

instagram = InstagramScraper()
instagram.set_proxies(proxies)

account = instagram.get_account('shaq')
account_id = account.get_id()
print(account._id)

more usages

See more usages

once again:
**Any star or contribution would be appreciated if it is helpful for you ~** 🙋‍♂️🌚

other

php library:https://github.com/postaddictme/instagram-php-scraper

About

A instagram scraper wrote in python. Similar to instagram-php-scraper.Usages are in example.py. Enjoy it!

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.