How to unpack Javascript in Python
<p>I would like to retrieve the contents of a javascript script instead of executing it upon requesting it. </p>

<p>EDIT: I understand that Python is not executing the javascript code. The issue is that when I request this online JS script it gets executed. I'm unable to retrieve the contents of the script. Maybe what I want is to decode the script like so <a href="http://jsunpack.jeek.org/dec/go" rel="nofollow">http://jsunpack.jeek.org/dec/go</a></p>

<p>That's what my code looks like to request the js file:</p>

<pre><code>def request(self, uri):
    data = None
    req = urllib2.Request(uri, data, self.header)
    response = urllib2.urlopen(req)
    html_text = response.read()
    return html_text.decode()
</code></pre>

<p>I know approximately what the insides of the script look like but all I get after the request is issued is a 'loaded' message. My guess is that the JS code gets executed. Is there any way to just request the code? </p>
