title: How to parse html from javascript variables with Jsoup in Java?
body: <p>I'm using Jsoup to parse html file and pull all the visible text from elements. The problem is that there are some html bits in javascript variables which are obviously ignored. What would be the best solution to get those bits out?</p>
  
  <p>Example:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;script&gt;
          var html = "&lt;span&gt;some text&lt;/span&gt;";
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;p&gt;text&lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>In this example Jsoup only picks up the text from <code>p</code> tag which is what it's supposed to do. How do I pick up the text from <code>var html</code> span? The solution must be applied to thousands of different pages, so I can't rely on something like javascript variable having the same name.</p>