ips

instagram-python-scraper

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

Showing:

Popularity

Downloads/wk

0

GitHub Stars

121

Maintenance

Last Commit

2yrs ago

Contributors

1

Package

Dependencies

0

License

MIT

Categories

Readme

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

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial