title: Updating an array in a html file with beautifulsoup
body: <p>in the script I'm running in Python, I want to open a local html file which has a javascript array inside a script tag which I want to update.</p>
  <p>This is a test code:</p>
  <pre><code>from bs4 import BeautifulSoup
  
  html = '''
  &lt;script&gt;
      var myArray = [
          {'name':'Michael', 'age':'30', 'birthdate':'11/10/1989'},
          {'name':'Mila', 'age':'32', 'birthdate':'10/1/1989'},
          {'name':'Paul', 'age':'29', 'birthdate':'10/14/1990'},
          {'name':'Dennis', 'age':'25', 'birthdate':'11/29/1993'},
          {'name':'Tim', 'age':'27', 'birthdate':'3/12/1991'},
          {'name':'Erik', 'age':'24', 'birthdate':'10/31/1995'},
      ]
      
      buildTable(myArray)
     '''
  
  soup = BeautifulSoup(html, 'lxml')
  scripts = soup.find_all('script')  # successfully captures the &lt;script&gt; element
  for script in scripts:
     print(script)
  </code></pre>
  <p>I don't know how to select the myArray variable and update it with a different one (which I have in my script)</p>