title: Reading file that contains multiple JSON objects (python)
body: <p>I have created a JSON file from my Google search API results.  I'm trying to read the file and parse the objects.  </p>
  
  <p>Each search result is one JSON array, which is shown below.  I have 200 of these arrays in a single JSON file.  </p>
  
  <pre><code>{
    "kind": "customsearch#result",
    "title": "text here",
    "htmlTitle": "text here",
    "link": "link here",
    "displayLink": "text here",
    "snippet": "text here",
    "htmlSnippet": "text here",
    "cacheId": "ID string",
    "formattedUrl": "text here",
    "htmlFormattedUrl": "link here",
    "pagemap": {
    "metatags": [
      {
        "viewport": "width=device-width, initial-scale=1"
      }
    ],
    "Breadcrumb": [
      {
        "title": "text here",
        "url": "link here",
      },
      {
        "title": "text here",
        "url": "link here",
      },
      {
        "title": "text here",
        "url": "link here",
      },
      {
        "title": "text here",
        "url": "link here",
      }
    ]
  }
  </code></pre>
  
  <p>I'm having an issue reading the JSON file into json.load(s).  </p>
  
  <p>How do I read this file and start parsing the items?</p>
  
  <pre><code>def ingest_json(input):
  try:
      with open(input, 'r', encoding='UTF-8') as f:
          json_data = json.loads(f)
  except Exception:
      print(traceback.format_exc())
      sys.exit(1)
  </code></pre>
  
  <p>throws this error:</p>
  
  <pre><code>TypeError: the JSON object must be str, 
  bytes or bytearray, not 'TextIOWrapper'
  </code></pre>
  
  <hr>
  
  <pre><code>def ingest_json(input):
  try:
      with open(input, 'r', encoding='UTF-8') as f:
          json_data = json.load(f)
  except Exception:
      print(traceback.format_exc())
      sys.exit(1)
  </code></pre>
  
  <p>throws this error:</p>
  
  <pre><code> raise JSONDecodeError("Extra data", s, end)
                     json.decoder.JSONDecodeError: Extra data: line 269 
                     column 2 (char 10330)
  </code></pre>