Justin  Azoff wrote:
> >>> from BeautifulSoup import BeautifulSoup
> >>> html='<link href="mystylesheet.css" rel="stylesheet" type="text/css">'
> >>> page=BeautifulSoup(html)
> >>> page.link.get('href')
> 'mystylesheet.css'

On second thought, you will probably want something like
>>> [link.get('href') for link in page.fetch('link',{'type':'text/css'})]
['mystylesheet.css']

which will properly handle multiple link tags.

-- 
- Justin

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to