googMeow.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:googMeow 作者: aaaddress1 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号