title: Can't get references between <script> tags in html file with json schema using python beautiful soup
body: <p>I need to access to json references in <em>local</em> html file with json schema. The references are located between first  tags in file.</p>
  <pre><code> &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;script&gt;
      // Script section to load models into a JS Var
      var defs = {}
          defs[&quot;AccountIdentifier&quot;] = {
    &quot;type&quot; : &quot;object&quot;,
    &quot;properties&quot; : {
      &quot;activity&quot; : {
        &quot;type&quot; : &quot;string&quot;,
        &quot;description&quot; : &quot;Describes the account state, if it has been activated or not.&quot;,
        &quot;enum&quot; : [ &quot;ACTIVE&quot;, &quot;INACTIVE&quot;, &quot;NOT_ACTIVATED&quot; ]
      }
  </code></pre>
  <p>However, when I use beautifulsoup, it doesn't take above  tags and takes the parts which are between the second  tags.</p>
  <p>My code is as below:</p>
  <pre><code>with io.open(localUrl, 'rt', encoding=&quot;utf-8&quot;) as file:
      print('Reading file..')
  
      soup = bs4.BeautifulSoup(file.read(), 'html.parser')
      print(soup)
      ab = soup.body.findAll(text='defs[&quot;ResourceReference&quot;]')
      print('Sample Reference', ab)
  </code></pre>
  <p>When I write soup to file, I get what I want - json references. However, it's lost when I print it to stdout.</p>
  <p>Note: I also tried PyQt5 using this video...: <a href="https://www.youtube.com/watch?v=FSH77vnOGqU&amp;t=537s" rel="nofollow noreferrer">https://www.youtube.com/watch?v=FSH77vnOGqU&amp;t=537s</a></p>