安装
pip3 install newspaper3k
使用
from newspaper import Article url = 'http://www.example.com/path/to/article' article = Article(url) article.download() article.parse() text = article.text # 获取新闻正文 images = article.images # 获取新闻图片