如果您只想获取标题标签,
html=urllib2.urlopen("http://somewhere").read()for item in html.split("</title>"): if "<title>" in item: print item[ item.find("<title>")+7: ]
如果您只想获取标题标签,
html=urllib2.urlopen("http://somewhere").read()for item in html.split("</title>"): if "<title>" in item: print item[ item.find("<title>")+7: ]