Tell me how to solve this problem, I have the same error when working with json. Here is the program that downloads photos from instagram
#!/usr/bin/env python3 import argparse import re import sys import requests def getID(username): url = "https://www.instagram.com/{}" r = requests.get(url.format(username)) html = r.text if r.ok: return re.findall('"id":"(.*?)",', html)[0] else: print("\033[91m✘ Invalid username\033[0m") sys.exit() def fetchDP(userID): url = "https://i.instagram.com/api/v1/users/{}/info/" r = requests.get(url.format(userID)) if r.ok: data = r.json() return data['user']['hd_profile_pic_url_info']['url'] else: print("\033[91m✘ Cannot find user ID \033[0m") sys.exit() def main(): parser = argparse.ArgumentParser( description="Download any users Instagram display picture/profile picture in full quality") parser.add_argument('username', action="store", help="username of the Instagram user") args = parser.parse_args() username = args.username user_id = getID(username) file_url = fetchDP(user_id) fname = username + ".jpg" r = requests.get(file_url, stream=True) if r.ok: with open(fname, 'wb') as f: f.write(r.content) print("\033[92m✔ Downloaded:\033[0m {}".format(fname)) else: print("Cannot make connection to download image") if __name__ == "__main__": main() but when i run it produces such an error 
C:\Users\red.iguana\Desktop\Practice\practice_3>python qqq.py bohvffhb Traceback (most recent call last): File "qqq.py", line 61, in <module> main() File "qqq.py", line 48, in main file_url = fetchDP(user_id) File "qqq.py", line 29, in fetchDP data = r.json() File "C:\Users\red.iguana\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\models.py", line 892, in json return complexjson.loads(self.text, **kwargs) File "C:\Users\red.iguana\AppData\Local\Programs\Python\Python36-32\lib\site-packages\simplejson\__init__.py", line 518, in loads return _default_decoder.decode(s) File "C:\Users\red.iguana\AppData\Local\Programs\Python\Python36-32\lib\site-packages\simplejson\decoder.py", line 370, in decode obj, end = self.raw_decode(s) File "C:\Users\red.iguana\AppData\Local\Programs\Python\Python36-32\lib\site-packages\simplejson\decoder.py", line 400, in raw_decode return self.scan_once(s, idx=_w(s, idx).end()) simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0) Tell me how to solve the problem
C:\Users\red.iguana\Desktop\Practice\practice_3>python qqq.py bohvffhb b'<!DOCTYPE html>\n<html lang="en" class="no-js not-logged-in client-root">\n <head>\n <meta ch' Traceback (most recent call last): File "qqq.py", line 62, in <module> main() File "qqq.py", line 49, in main file_url = fetchDP(user_id) File "qqq.py", line 30, in fetchDP data = r.json() File "C:\Users\red.iguana\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\models.py", line 892, in json return complexjson.loads(self.text, **kwargs) File "C:\Users\red.iguana\AppData\Local\Programs\Python\Python36-32\lib\site-packages\simplejson\__init__.py", line 518, in loads return _default_decoder.decode(s) File "C:\Users\red.iguana\AppData\Local\Programs\Python\Python36-32\lib\site-packages\simplejson\decoder.py", line 370, in decode obj, end = self.raw_decode(s) File "C:\Users\red.iguana\AppData\Local\Programs\Python\Python36-32\lib\site-packages\simplejson\decoder.py", line 400, in raw_decode return self.scan_once(s, idx=_w(s, idx).end()) simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
data = r.json()addprint(r.content[:100])and show the result. I think you are not json back - gil9redprint(r.content[:100])addprint(r.status_code). What code did you get back? - gil9red