title: How can I strip all the HTML content from a JSON file?
body: <p>I want to clean a JSON file of incorrectly extracted HTML content by throwing away all the text which is enclosed in HTML tags, including the tags themselves.</p>
  
  <p>I tried this function: </p>
  
  <pre class="lang-py prettyprint-override"><code>def stripIt(s):
      txt = re.sub('&lt;/?[^&lt;]+?&gt;.*?&lt;/[^&lt;]+?&gt;', '', s)
      return re.sub('\s+', ' ', txt)
  </code></pre>
  
  <p>but when I applied it to the JSON file, it probably breaks the JSON file, giving some errors.</p>
  
  <p>The HTML content is also broken with missing tags, only closing tags, and so on.</p>
  
  <p>So how can I strip all the HTML content from a JSON file, without breaking the file?</p>