Regex Help

Miki miki.tebeka at gmail.com
Tue Sep 23 04:57:17 EDT 2008


Hello,

> Anybody know of a good regex to parse html links from html code?
BeautifulSoup is *the* library to handle HTML

from BeautifulSoup import BeautifulSoup
from urllib import urlopen

soup = BeautifulSoup(urlopen("http://python.org/"))
for a in soup("a"):
    print a["href"]

HTH,
--
Miki <miki.tebeka at gmail.com>
http://pythonwise.blogspot.com



More information about the Python-list mailing list