title: Parsing HTML to get JSON swift
body: <p>I'm new with Swift and am trying to get the JSON data from HTML I grabbed. I get the HTML from a website and there's one line in the whole result that has the data. Setup like: <code>var obj = *JSON data*</code></p>
  
  <p>How can I parse through the string results to only get that line and convert the data (right side of the equal sign) to JSON?</p>
  
  <p>Here's my code to get the data (testURL is the url of the website):</p>
  
  <pre><code>if let url = testURL {
      do {
            let contents = try String(contentsOf: url)
            print(contents)
         } catch {
            // contents could not be loaded
         }
      } else {
         // the URL was bad!
   }
  </code></pre>