python快速抓取新闻标题及内容

from newspaper import Article

url = '你想要爬取的网站url' news = Article(url, language='zh')
news .download() #先下载 news .parse() #再解析
print(news.text) #新闻正文 print(news.title) #新闻标题 print(news.html) #未修改的原始HTML print(news.authors) #新闻作者 print(news.keywords) #新闻关键词
print(news.images) #本文中的所有图像url
print(news.imgs) #本文中的所有图像url
原文地址:https://www.cnblogs.com/yao950814/p/9852543.html