安装
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 # 获取新闻图片
安装
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 # 获取新闻图片
import requests data = { 'channel': '99x', 'called_number': '135xxx', 'tts_code': 'TTS_xx', 'tts_p