Python的newspaper
安装:
pip3 install newspaper3k
github:
https://github.com/codelucas/newspaper
什么是网络正文?
例子
参考官方的例子,进行如下尝试:
博客
>>> from newspaper import Article
>>> url = 'https://blog.csdn.net/LU_ZHAO/article/details/104860830'
>>> 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 seconds.
Prefix dict has been built succesfully.
>>> print