Fill Javascript form

Jeremiah Dodds jeremiah.dodds at gmail.com
Tue May 12 04:34:40 EDT 2009


On Tue, May 12, 2009 at 9:15 AM, Matteo <tadwelessar at gmail.com> wrote:

> On 11 Mag, 23:06, Shawn Milochik <Sh... at Milochik.com> wrote:
> > How is the form "written in JavaScript"? Is it dynamically generated?
> >
> > In any case, can you just send a POST request if you know the values
> required?
>
> The problem is indeed that the form is dynamically generated.
> That's the .js file:
>
> if (navigator.appVersion.indexOf("MSIE")!=-1)
> document.write("<script type='text/javascript' id='chillicontroller'></
> script>");
>
> if (!window.queryObj) {
>    window.queryObj = new Object();
>    window.location.search.replace(new RegExp("([^?=&]+)(=([^&]
> *))?","g"), function($0,$1,$2,$3) { queryObj[$1] = $3; });
>    if (queryObj['uamip'] == null && queryObj['uamport'] == null)
> {queryObj['uamip']='10.192.0.1';queryObj['uamport']='3990';}
> }
>
> if (queryObj['uamip'] != null && queryObj['uamport'] != null) {
>    var script = document.getElementById('chillicontroller');
>    if (script == null) {
>  //    document.write('manutenzione');
>        script = document.createElement('script');
>        script.id = 'chillicontroller';
>        script.type = 'text/javascript';
>        script.src = 'http://'+queryObj['uamip']+':3990/www/
> chillijs.chi';
>
>        var head = document.getElementsByTagName("head")[0];
>        if (head == null) head = document.body;
>        head.appendChild(script);
>   }
>   script=document.getElementById('chillicontroller');
>   if(script==null)document.write('manutenzione');
>    script.src = 'http://'+queryObj['uamip']+':3990/www/chillijs.chi';
>
> } else {
> //document.write('manutenzione');
>    var noLocation = document.getElementById("noLocation");
>    if (noLocation != null && noLocation.style) {
>       noLocation.style.display = 'inline';
>     }
> }
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>


Use firebug or something similar (HTTPFox) to take a look at what you should
be sending as a post, and then just send that it your python script. Worst
case scenario is that you need to reverse-engineer a javascript-generated
session-id-type-thing, but that's pretty rare. Most likely, you don't even
need to grab the page.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090512/e8810919/attachment-0001.html>


More information about the Python-list mailing list