[Answered ]-Python: String variable is unrecognized in JSON, but hardcoded string works (Instagram API)

2👍

✅

If you want to compare with the username, you should do that, rather than comparing with the string representation of the User object; they may be the same, but they probably aren’t.

ig_username = user.username

Also, not related to your problem but you should really use the Instagram Python library, which makes this sort of thing a bit easier.

Leave a comment