473,372 Members | 799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

Seekable output from ClientForm?

Hi,

using python 2.3, ClientForm, and ClientCookie and I have this code:

opener = ClientCookie.build_opener(ClientCookie.HTTPReferer Processor,
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?

Thanks a lot,

Matej
Jul 18 '05 #1
2 1648
mac
In article <35*************************@posting.google.com> , Matej Cepl wrote:
Hi,

using python 2.3, ClientForm, and ClientCookie and I have this code:

opener = ClientCookie.build_opener(ClientCookie.HTTPReferer Processor,
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

Jul 18 '05 #2
Thanks a lot!

Matej

Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: narke | last post by:
Does anyone here use ClientForm to handle a HTML form on client side? I got a form, within which there is a image control, it direct me to another page if i use mouse click on it. the code of...
0
by: kostem | last post by:
Hi, I need some help on using ClientForm to post to cgi and getting response. I have done this many times and it worked very well until now. I have contacted the webmaster of the page I'm...
0
by: m0sf3t | last post by:
Does anyone here use ClientForm to handle a HTML form on client side? I try to open this page https://www.orange.ch/footer/login but got this message File...
0
by: Joe Johnson | last post by:
Greetings, I just did a fresh install of Solaris 10 on Sparc. The OS ships with perl_5.8.4. When I run some of my scripts that run fine on Linux, I get this: IO::Seekable::getpos missing at...
0
by: dany_gates | last post by:
hi, Need some help on Network Streams in .NET. I m planning to build a .NET application which mimicks Download Accelerator Plus (DAP:famous downloading application). So naturally i want to...
6
by: Hardy Wang | last post by:
Hi all: The Stream object from WebRequest.GetResponseStream() is non-seekable. How can I convert this stream to a byte array? For ordinary Stream (seekable), I can use...
0
by: emiliano | last post by:
Hey guys, i was just googling some information about how to use the ClientForm package with a page which requires HTTP basic authentication and i got here :P ... So here is the problem, lets see if...
1
by: Gordon Airporte | last post by:
I've written a script using ClientForm to automate opening and closing ports on my Linksys router. It works, but I wonder if there isn't a better way to do it. The problem is that the list of...
2
by: hp1980 | last post by:
Hi, I'm writing a web automation script using ClientForm and urlgrabber. I use urlgrabber because I need the "http keepalive" which doesn't exist in urllib2. I'm facing a problem, the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.