title: How to get html with javascript rendered sourcecode by using selenium
body: <p>I run a query in one web page, then I get result url. If I right click see html source, I can see the html code generated by JS. If I simply use urllib, python cannot get the JS code. So I see some solution using selenium. Here's my code:</p>
  <pre><code>from selenium import webdriver
  url = 'http://www.archives.com/member/Default.aspx?_act=VitalSearchResult&amp;lastName=Smith&amp;state=UT&amp;country=US&amp;deathYear=2004&amp;deathYearSpan=10&amp;location=UT&amp;activityID=9b79d578-b2a7-4665-9021-b104999cf031&amp;RecordType=2'
  driver = webdriver.PhantomJS(executable_path='C:\python27\scripts\phantomjs.exe')
  driver.get(url)
  print driver.page_source
  
  &gt;&gt;&gt; &lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;         Obviously It's not right!!
  </code></pre>
  <p>Here's the source code I need in right click windows, (I want the INFORMATION part)</p>
  <pre><code>&lt;/script&gt;&lt;/div&gt;&lt;div class=&quot;searchColRight&quot;&gt;&lt;div id=&quot;topActions&quot; class=&quot;clearfix 
  noPrint&quot;&gt;&lt;div id=&quot;breadcrumbs&quot; class=&quot;left&quot;&gt;&lt;a title=&quot;Results Summary&quot;
  href=&quot;Default.aspx?    _act=VitalSearchR ...... &lt;&lt;INFORMATION I NEED&gt;&gt; ... 
  to view the entire record.&lt;/p&gt;&lt;/div&gt;&lt;script xmlns:msxsl=&quot;urn:schemas-microsoft-com:xslt&quot;&gt;
  
          jQuery(document).ready(function() {
              jQuery(&quot;.ancestry-information-tooltip&quot;).actooltip({
  href: &quot;#AncestryInformationTooltip&quot;, orientation: &quot;bottomleft&quot;});
          });
  </code></pre>
  <p>So my question is: How to get the information generated by JS?</p>