安装模块:
pip install newspaper3k
文档:
import newspaper
url = 'http://dqmzj.daqing.gov.cn/819/30749.html'
new = newspaper.Article(url,language='zh')
new.download()
new.parse()
print(new.text)
print(new.url)
print(new.title)
pip install newspaper3k
import newspaper
url = 'http://dqmzj.daqing.gov.cn/819/30749.html'
new = newspaper.Article(url,language='zh')
new.download()
new.parse()
print(new.text)
print(new.url)
print(new.title)