web scrapping - POST and auto-login

Max Erickson maxerickson at gmail.com
Mon Sep 19 23:18:33 EDT 2005


"james <at> hal-pc.org" wrote in
news:432f787e$0$10630$a726171b at news.hal-pc.org: 

> "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.

strings are slicable:

>>> s='a string of characters'
>>> s[:10]
'a string o'
>>> s[-10:]
'characters'
>>> 

As far as your other problem, it might make sense(I don't know...) to 
just generate the post request for saving the new password yourself 
and never bother with parsing/filling the form.

max



More information about the Python-list mailing list