I'm using pyscripter 1.7.2, on a Win XP Prof 2002 - service pack 2 machine to script a website. I have no problem logging into the site, loading and an xml file, and retrieving the confirmation transaction code xml file, but when I go to the reports page and try to grab a report, I run into a problem. The "Get Report" button code within the web page is the following:
Expand|Select|Wrap|Line Numbers
- <input type="button" name="change" value="Get Report" onclick="getReport()" class="Button">
Expand|Select|Wrap|Line Numbers
- function getReport(){
- var elm = getEventElm();
- var form = getParent(elm,"form");
- form.action = 'demandBids.do?method=report';
- form.target = "_top";
- form.submit();
- form.action = 'demandBids.do?method=view';
- form.target = "main";
- }
<action="/emkt/demand/demandBids.do?method=view">
to the following:
<action="/emkt/demand/demandBids.do?method=report">
and brings up a browser "file download" window. I would usually just do a
Expand|Select|Wrap|Line Numbers
- response = br.submit().read()
Does anyone have any input on how I can handle this situation??? Is there a way to invoke the javascript from python itself?? Is there a way to change the "input type" of the button to make mechanize see it as clickable??? Should I try to change the action of the form itself??? Any input on this problem would be greatly appreciated. Thank you.