Advertisement

基于算法的网页正文识别与提取实践

阅读量:

Python newspaper库应用

配置:

复制代码
    pip3 install newspaper3k
    
    
      
    

github:

https://github.com/codelucas/newspaper

什么是网络正文?

简单介绍什么是网络正文。

小标题

依照权威案例为基准,开展以下探索性实践:

博客

复制代码
    >>> from newspaper import Article
    >>> url = ''
    >>> article = Article(url, language = 'zh')
    >>> article.download()
    >>> article.parse()
    Building prefix dict from /usr/local/lib/python3.7/site-packages/jieba/dict.txt ...
    Dumping model to file cache /var/folders/zf/n2xjp7t53yg_m7wyrjt6p1_40000gn/T/jieba.cache
    Loading model cost 2.059746742248535 second

全部评论 (0)

还没有任何评论哟~