title: Automating file downloads with Javascript URLs using Python
body: <p>I was assigned to automate the download of several csv files from a site heavily encoded in Javascript (https://www.quantcast.com/download/plannerCSV?&amp;d0Id=01&amp;sc=1&amp;mr=10000&amp;rs2=-1). There is a convenient 'download' button that prompts the download, the URL of which I found using Firebug:</p>
  
  <p><a href="https://www.quantcast.com/download/plannerCSV?&amp;d0Id=10&amp;sc=1&amp;mr=10000" rel="nofollow">https://www.quantcast.com/download/plannerCSV?&amp;d0Id=10&amp;sc=1&amp;mr=10000</a></p>
  
  <p>However, to the best of my knowledge, the URL must end in .csv in order for the urllib2 module in python to read/write it to my disk. Is there any way of obtaining a URL for this file that ends in .csv so I can automate the download using python?</p>
  
  <p>I prefer to use python to write the script, but if there is another approach to achieve this task that is more sensible/straightforward, I would love to know about it. Any guidance is appreciated! Thanks =)</p>
  
  <p><strong>(edit) to clarify</strong>: The data I'm trying to download consists of a giant (regularly-updated) list, which can be filtered in many different ways based on which checkboxes are checked. The URL changes based on the checkboxes, so I believe the URL may invoke a Javascript call that generates a new csv file each time.</p>