title: Retrieve the source of a dynamic website using python (bypassing onclick)
body: <p>I wish to retrieve the source of a website, that is dynamically generated upon clicking a link. The link itself is as below:</p>
  
  <pre><code>&lt;a onclick="function(); return false" href="#"&gt;Link&lt;/a&gt;
  </code></pre>
  
  <p>This stops me from directly querying for a URL that would allow me to get the dynamically generated website (urllib/2). </p>
  
  <p>How would one retrieve the source of the website, which was generated with the above function (in HTML) via python? Is there a method to bypass the <code>return false" href="#"</code>? Or the <code>onclick</code> entirely, and get the actual URL?</p>
  
  <p>If there is another way to generate the website from the abstract link above, so that one can get it from urllib in python, please refer me to it.</p>
  
  <hr>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I generalized the code seen above - however I've been told that one has to reverse engineer the specific javascript to be able to use it.</p>
  
  <p>Link to .js - <a href="http://a.quizlet.com/j/english/create_setku80j8.js" rel="nofollow noreferrer">http://a.quizlet.com/j/english/create_setku80j8.js</a></p>
  
  <p>Link to site with link:</p>
  
  <pre><code>&lt;a onclick="importText(); return false" href="#"&gt;Bulk-import data&lt;/a&gt;
  </code></pre>
  
  <p>Actual URL of site: <a href="http://quizlet.com/create_set/" rel="nofollow noreferrer">http://quizlet.com/create_set/</a></p>
  
  <p>Beautified JS of relevant .js above: <a href="http://pastie.org/737042" rel="nofollow noreferrer">http://pastie.org/737042</a></p>