title: Parsing HTML page containing JS in Java
body: <p>I am trying to parse a web page, which contains some JS. Till now I am using <code>Jsoup</code> to parse html in Java, which is working as expected. But I am unable to parse the JavaScript. Below is the snippet of the HTML page-</p>
  
  <pre class="lang-default-markup prettyprint-override"><code>&lt;script type="text/javascript"&gt; 
  var element = document.createElement("input"); 
  element.setAttribute("type", "hidden");
  element.setAttribute("value", "");
  element.setAttribute("name", "AzPwXPs");
  element.setAttribute("id", "AzPwXPs");
  var foo = document.getElementById("dnipb"); 
  foo.appendChild(element);
  var element1 = document.createElement("input"); 
  element1.setAttribute("type", "hidden");
  element1.setAttribute("value", "6D6AB8AECC9B28235F1DE39D879537E1");
  element1.setAttribute("name", "ZLZWNK");
  element1.setAttribute("id", "ZLZWNK");
  foo.appendChild(element1);
  &lt;/script&gt;
  </code></pre>
  
  <p>I want to read both the values with their <code>name</code>/<code>id</code>. So that after parsing I can get following results- </p>
  
  <pre><code>AzPwXPs=
  ZLZWNK=6D6AB8AECC9B28235F1DE39D879537E1
  </code></pre>
  
  <p>How to parse in this situation?</p>