[Zope] Zope URL/Page Retrieval with Python

Bakhtiar A Hamid kedai at kedai.com.my
Sat Nov 15 10:25:02 EST 2003


Samir Mishra <SamirMishra at cbuae.gov.ae> wrote ..
> The Zope site I'm trying to access is on another server. I'm accessing
> it
> remotely, so I can't use external methods. I wanted to access the web page
> and parse the HTML for relevant info.
> 
> And I found the answer to my question on another mailing list. If anyone's
> interested --
> 
> 
> import urllib
> 
> URLsite = "http://username:password@zserver:8080/everything/else/on/path"
> 
> usock = urllib.urlopen(URLsite)
> data = usock.read()
> usock.close()
> 
 
<shameless plug>
you could also try a zope product that does all that.  get KebasData at
http://www.zope.org/Members/kedai/KebasData

-it has a timeout (default 15s) using timeoutsocket.py (will probably update 
that once zope runs pythn2.3)
-it can parse anything as you want
</shamless plug>

feedback welcome.




More information about the Zope mailing list