#!python # vim:fileencoding=utf-8 from HTMLParser import HTMLParser import urllib2 from urlparse import urlparse class ExtractTextLinkParser(HTMLParser): def __init__(self): HTMLParser.__init__(self) self.links = [] self.url = "" self.text = "" def handle_starttag(self, tag, attrs): # 開始タグを見つけた場合の処理 if tag == "a": # タグ、属性名は全て小文字 attrs = dict(attrs) # ((属性名, 値), ...) => {属性名:値, ...} if "href" in at

