Hello,

I have defined a function with:

def URLReader(url) :
   try :
       f = urllib2.urlopen(url)
       data = f.read()
       f.close()
   except Exception, e :
       raise MyError.StopError(e)
   return data

which get the HTML source code from an URL. I use this to get a part of a HTML document without any HTML parsing, so I call (I would like to get the download link of the boost library):

found = re.search( "<a href=\"/projects/boost/files/latest/download\?source=files\" title=\"/boost/(.*)", Utilities.URLReader("http://sourceforge.net/projects/boost/files/boost/";) )
if found == None :
        raise MyError.StopError("Boost Download URL not found")

But found is always None, so I cannot get the correct match. I didn't find the error in my code.

Thanks for help

Phil
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to