Python-Instagram user_recent_media returning next of none
I'm retrieving posts from Instagram with Python and populating a MySQL database. The user is myself so I have excluded the userid= parameter although I have also tried it with this in place. Below is a snippet of my code, when I print next_ at the end, it returns 'None' and so the second while loop doesn't start. The first iteration works fine and populates the database no problem. The code should process through all posts, in the populate function I have an if statement to take care of posts that I already have in the database and intend to make this more sophisticated by stopping the code once I reach this point. But for now this should work. Any ideas? while True: try: media_feed, next_ = api.user_recent_media() populate(media_feed) print("Processing") break except InstagramAPIError as e: if (e.status_code == "429"): print(e) print("Waiting") Wait(3600) else: print(e) break print(next_) while next_: while True: try: media_feed, next_ = api.user_recent_media(with_next_url=next_) populate(media_feed) print("Processing") break except InstagramAPIError as e: if (e.status_code == "429"): print(e) print("Waiting") Wait(3600) else: print(e) break
Select all by type: Geometry. Equivalent Python script?
Sorting algorithm doesn't work
How to avoid “Name 're' is not defined” error while connecting pycharm remote debugger?
Python - Generate binary list with itertools
Capture domain and path from URL with regex
Pylab animation multiple figures
Django Password Reset Email Error 10060
Excel delimited file
Why is scrapy dumping thousands of `ERROR` log messages without any description of the error?
Python 2.5.4: how to find sum of logarithm values
Posting a json data in url — Python
How to Covert to dictionary in Python
Python __getitem__ error
How do I use the 'json' module to read in one JSON object at a time?
Error handling with verbose output
Python file transfer completes only after Control-C