title: Python Get Redirect URL with Javascript
body: <p>I am trying to get the redirected URL which has JavaScript action while redirecting to the target site</p>
  
  <pre><code>user_agent = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like    Gecko) Chrome/22.0.1207.1 Safari/537.1)'
  headers = { 'User-Agent' : user_agent }
  values = {'name' : 'DealsIndex',  'location' : 'South Bay',  'language' : 'Perl' }
  data = urllib.urlencode(values)
  req = urllib2.Request("http://www.techbargains.com/jump.cfm?clkSubId=A0AC1A00319410C5900&amp;afsrc=1&amp;id=6860", data, headers)
  res = urllib2.urlopen(req)
  urlapp = res.geturl()
  print urlapp
  </code></pre>
  
  <p><strong>Actual Output:</strong></p>
  
  <pre><code>http://www.techbargains.com/jump.cfm?clkSubId=A0AC1A00319410C5900&amp;afsrc=1&amp;id=6860
  </code></pre>
  
  <p><strong>Expected Output</strong></p>
  
  <pre><code>http://shop.panasonic.com/?cm_MMC=AffiliateBanner-_-SeriouslyCool-_-88x31-_-041911
  </code></pre>
  
  <p>I tried using mechanize as well but I am not able to get to the target site.</p>