web scrapping - POST and auto-login

james <at> hal-pc.org james <at> hal-pc.org
Tue Sep 20 04:47:05 CEST 2005


"james <at> hal-pc.org" wrote:
> the entire 26 character string from site A, but [1] how do i crop it to 
> 10 characters.

[1] still at a loss on this one, but i can get to it later, unless you've got 
any ideas.

>   [2] how can i then auto-login to site B (the router's web config via 
> pop-up dialog box. *not* a form) and then [3] post VARIABLE and save the 
> changes.

ok.. this one was stupid easy.  should have remembered that.
[2] http://user:password@wifirouter/WL_WPATable.asp

>   If there is any other info i can provide (ie. sections of relevent 
> HTML) then let me know.  any assistance you have to offer is greatly 
> appreciated.

argh!
[3]
now i'm trying to get it to find the BUTTON "Save Settings".  from what i see in 
the code it's labled "save_button", but i only get:
------------------------
...
...
   <IgnoreControl(save_button"=<None>)>
   <IgnoreControl(cancel"=<None>)>>
Traceback (most recent call last):
   File "./wifi.py", line 19, in ?
     response = urlopen(form.click("save_button"))
   File "/usr/local/lib/python2.4/site-packages/ClientForm.py", line 2628, in click
     self._request_class)
   File "/usr/local/lib/python2.4/site-packages/ClientForm.py", line 2788, in _click
     control = self._find_control(name, type, "clickable", id, None, nr)
   File "/usr/local/lib/python2.4/site-packages/ClientForm.py", line 2783, in 
_find_control
     raise ControlNotFoundError("no control matching "+description)
ClientForm.ControlNotFoundError: no control matching name 'save_button', kind 
'clickable'
---------------------------

relevent HTML:
---------------------------
...
...
           <TD 
height=25>&nbsp;<script>Capture(wlansec.key1)</script>&nbsp;:&nbsp;</TD>
           <TD height=25>&nbsp;<INPUT size=36 name=wl_key1 value='5465a6576b'></TD>
...
...
<script>document.write("<input type=button name=save_button" + " value=\"" + 
sbutton.save + "\" onClick=to_submit(this.form)>");</script>&nbsp;
...
...
---------------------------

any ideas on making it "see" the button for what it is in amongst the garbage? 
I think /it's/ getting confused here.



More information about the Python-list mailing list