I\'m trying to download file with Python using IE:
from win32com.client import DispatchWithEvents
class EventHandler(object):
def OnDownloadBegin(self):
You don't need to use IE. You could use something like
import urllib2
data = urllib2.urlopen("http://website/file.xml").read()
Update: I see you've updated your question. If you need to use a browser, then clearly this answer isn't appropriate for you.
Further update: When you click the button which is generated by JavaScript, if the URL retrieved is not computed by the JavaScript, and only the button is, then you can perhaps retrieve that URL via urllib2
. On the other hand, you might also need to pass a session cookie from your authenticated session.