There is a library for instagram access from python . To log in, you need the following code:
from instagram.client import InstagramAPI access_token = "YOUR_ACCESS_TOKEN" # get this from instagram client_secret = "YOUR_CLIENT_SECRET" # this, too, from instagram api = InstagramAPI(access_token=access_token, client_secret=client_secret) recent_media, next_ = api.user_recent_media(user_id="userid", count=10) for media in recent_media: print media.caption.text
In other words, do not reinvent the wheel.
source share