Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to login successfully in Instaloader in python?

I am trying to scrape data from Instagram using the 'instaloader' python modules. When using this code:

import instaloader

L = instaloader.Instaloader()
L.login(USERNAME, PASSWORD)

The code throws the following error:

ConnectionException: Login error: Unexpected response, this might indicate a blocked IP.

I've tried looking through the documentation and GitHub issues, but can't seem to find a solution. Please advise how to login successfully, or any other modules that I can use to scrape data?

like image 339
shahzaib.hayan Avatar asked Mar 05 '26 11:03

shahzaib.hayan


1 Answers

This can be resolved by logging in to your browser and then running the script.

I'm not sure of the cause, but that's how I fixed it.

Please note some of Instaloaders functionalities are currently not working, presumably due to an update on Instagram.

like image 78
Kal-Toh Avatar answered Mar 07 '26 01:03

Kal-Toh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!