微慑信息网

[python] Arc90’s readability.js -vulsee.com

近期有接口需要通过获取URL内容,再根据内容获取关键字,介于不同网页的格式不同,要采用传统办法去读取内容,需要提前设定规则,

今天在群里问到fun大佬,

目前用了Arc90's readability.js 和Apple Safari阅读模式的ReaderArticleFinderJS

刚好python下有readability,直接拿来用了

pip install readability-lxml

 

#coding:utf-8
import requests
from readability import Document
response = requests.get('https://vulsee.com/archives/vulsee_2022/0107_16048.html')
doc = Document(response.text)
title = doc.title()
print (title)
content = doc.summary()
print (content)

本文标题:[python] Arc90’s readability.js -vulsee.com
本文链接:
(转载请附上本文链接)
https://vulsee.com/archives/vulsee_2022/0118_16073.html
转载请附本站链接,未经允许不得转载,,谢谢:微慑信息网-VulSee.com » [python] Arc90’s readability.js -vulsee.com
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

微慑信息网 专注工匠精神

访问我们联系我们