Python Html, Xml Parser - BeautifulSoup

| 3 Comments | No TrackBacks
  • Homepage and Document
http://www.crummy.com/software/BeautifulSoup/

  • Sample
import urllib2
import BeautifulSoup

urlHandle = urllib2.urlopen( "http://www.kyobobook.co.kr" )
buffer = urlHandle.read();

soup = BeautifulSoup.BeautifulSoup( buffer );
soup.prettify();

linkList = soup.findAll('a')
for link in linkList:
    linkStr = str(link)
    print link.get(u'href')

No TrackBacks

TrackBack URL: http://www.thethinkings.com/mt/mt-tb.cgi/26

3 Comments

fantasticarticle. i desiremy academyoffered stuff like this.

hey, I added ur site to my RSS reader. the posts are awesome! :)

Brilliant post. Just found it on AOL. Thanks for the useful info. Keep up the great work :)

Leave a comment