how to get text between HTML tags with URLLIB??

sp00fD sp00fD at yahoo.com
Fri Aug 18 20:51:27 EDT 2000


In article <Pine.GSO.4.21.0008181829180.905-100000 at y.glue.umd.edu>,
  Roy Katz <katz at Glue.umd.edu> wrote:
> Hello,
>
>
>  <a href=http://wacky.roey.com > 'Roey's Wacky Server of Fun!' </a
href>
>
> This is really frustrating.  Why isn't this mentioned in the urllib
docs?
> deranged pythoneer
>
>

I take it that you don't want to use a regex?

#completely untested...but may work ;)
p = re.compile(r'<a href=([^>])', re.IGNORECASE)
stripped_url = p.sub('\1', url)



Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list