In article <[EMAIL PROTECTED]>, Matej Cepl wrote:
> Hi,
>
> using python 2.3, ClientForm, and ClientCookie and I have this code:
>
> opener = ClientCookie.build_opener(ClientCookie.HTTPRefererProcessor,
> ClientCookie.HTTPRefreshProcessor,
> ClientCookie.SeekableProcessor)
>
> response = opener.open(lxURL)
> forms = ClientForm.ParseResponse(response)
> form = forms[0]
> response.seek(0)
>
> form['extpatid'] = MyNEUlogin
> form['extpatpw'] = MyNEUpassword
> formopener = form.click()
>
> response2 = ClientCookie.urlopen(formopener)
>
> guidednews = re.compile("s_guidednews.html")
>
> response2.seek(0)
> h = htmllib.HTMLParser(formatter.NullFormatter())
> h.feed(response2.read())
> print h.anchorlist
>
> Unfortunately, it doesn't work, because response2 was created by
> ClientForm and it is not seekable (apparently, I get "AttributeError:
> addinfourl instance has no attribute 'seek'").
>
> How to make output of ClientForm seekable, please?
Instead of:
response2 = ClientCookie.urlopen(formopener)
try:
opener.open(formopener)
Cheers,
Maciek
--
http://mail.python.org/mailman/listinfo/python-list