def printImportScreen(title, url, src, keyword):
print '====================================='
title = (title.encode('utf-8').replace(' ',''))[:50] + '...'
print 'Found Keyword in the page "%s"' % (title)
print 'URL: %s' % url
print '====================================='
h = html2text.HTML2Text()
h.ignore_links = True
foundKey = False
listCount = 0
gg = h.handle(src)
for i in gg.encode('utf-8').split('\n'):
if keyword in i: foundKey = True
if i == '\n': continue
if foundKey:
listCount += 1
if listCount > 10:
break
print i
return
评论列表
文章目录