title: How to use real jquery in python to extract data from a web page?
body: <p>Many python html parser like <code>lxml</code>, <code>pyquery</code> don't know which element is <code>display:none</code> or not, <code>.text()</code> function often get comment or something else in <code>&lt;script&gt;</code>, and so on bugs.</p>
  
  <p>such as below html:</p>
  
  <pre><code>&lt;tr class="" rel="21261811"&gt;
           &lt;td class="leftborder timestamp" rel="1451972762"&gt;&lt;span class="updatets "&gt;
  14secs&lt;/span&gt;&lt;/td&gt;
           &lt;td&gt;&lt;span&gt;&lt;style&gt;
  .yc_S{display:none}
  .qDiU{display:inline}
  .VXrU{display:none}
  .JoAO{display:inline}
  .DEIS{display:none}
  .p6YU{display:inline}
  &lt;/style&gt;&lt;span style="display:none"&gt;132&lt;/span&gt;&lt;div style="display:none"&gt;132&lt;/div&gt;&lt;span class="95"&gt;189&lt;/span&gt;&lt;span class="yc_S"&gt;243&lt;/span&gt;&lt;div style="display:none"&gt;243&lt;/div&gt;.&lt;span class="DEIS"&gt;70&lt;/span&gt;&lt;div style="display:none"&gt;70&lt;/div&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="VXrU"&gt;208&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span style="display: inline"&gt;219&lt;/span&gt;&lt;span style="display: inline"&gt;.&lt;/span&gt;&lt;span style="display:none"&gt;131&lt;/span&gt;&lt;span class="VXrU"&gt;131&lt;/span&gt;&lt;span style="display: inline"&gt;210&lt;/span&gt;&lt;span class="115"&gt;.&lt;/span&gt;&lt;span style="display: inline"&gt;153&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; 
           &lt;td&gt;
  10000&lt;/td&gt;
               &lt;td style="text-align:left" rel="mx"&gt;&lt;span class="country" style="white-space:nowrap;"&gt;
  
  
  
  &lt;img src=" style="width: 16px; height: 11px; margin-right: 5px;" class="flags-mx" alt="flag "&gt;Mexico&lt;/span&gt;
  &lt;/td&gt;
  
           &lt;td&gt; &lt;div class="progress-indicator" style="width: 114px" value="1839" levels="speed" rel="1839"&gt;
          &lt;div class="indicator" style="width: 82%; background-color: rgb(0, 173, 173)"&gt;&lt;/div&gt;
          &lt;/div&gt;
           &lt;/td&gt;
               &lt;td&gt; 
                   &lt;div class="progress-indicator " style="width: 114px" title="" rel="271" value="271" levels="speed"&gt;
                              &lt;div class="indicator" style="width: 95%; background-color: rgb(0, 173, 173)"&gt;&lt;/div&gt;
  
          &lt;/div&gt;
               &lt;/td&gt;
  
               &lt;td&gt;socks4/5&lt;/td&gt;
               &lt;td nowrap=""&gt;High +KA&lt;/td&gt;
  
           &lt;/tr&gt;
  </code></pre>
  
  <p>The <code>$('tr').text()</code> output should be a IP address.But ugly result in lxml or pyquery.(Actually <code>$('tr').text()</code> in Jquery can not get the IP too, need some <code>Jquery basic filter</code>,which lxml or pyquery don't support)</p>
  
  <p>For now, I have to use selenium build-in selector to avoid above problem.
  But I'd like to find a ultimate way to solve such problem.
  <strong>The way</strong> using <code>Jquery</code> to parse html.</p>
  
  <p>After some searching, I only find <code>pyv8</code> can eval javascript in python.</p>
  
  <p>I'd like to use a phantomjs broker to get html, and let jquery to process it.</p>
  
  <p>But <code>pyv8</code>'s docs is so few that I can't catch the point.</p>
  
  <p>Any example or other solution is welcome, thank you!</p>