使用readability-lxml 提取网页标题和主体内容 - 尝试

python-readabilityGiven a html document, it pulls out the main body text and cleans it up.This is a python port of a ruby port of arc90’s readability project.python-readability可以获取一个HTML文献的主体内容:...
摘要由CSDN通过智能技术生成
python-readability

Given a html document, it pulls out the main body text and cleans it up.
This is a python port of a ruby port of arc90’s readability project.

python-readability可以获取一个HTML文献的主体内容:

gIthub:https://github.com/buriy/python-readability
pypi:https://pypi.org/project/readability-lxml/

Installation
:pip3 install readability-lxml
Collecting readability-lxml
  Downloading https://files.pythonhosted.org/packages/af/a7/8ea52b2d3de4a95c3ed8255077618435546386e35af8969744c0fa82d0d6/readability-lxml-0.7.1.tar.gz
Collecting chardet
  Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
     |████████████████████████████████| 143kB 412kB/s 
Requirement already satisfied: lxml in /usr/local/lib/python3.7/site-packages (from readability-lxml) (4.5.0)
Requirement already satisfied: cssselect in /usr/local/lib/python3.7/site-packages (from readability-lxml) (1.1.0)
Building wheels for collected packages: readability-lxml
  Building wheel for readability-lxml (setup.py) ... done
  Created wheel for readability-lxml: filename=readability_lxml-0.7.1-cp37-none-any.whl size=16481 sha256=acfc6743aa167f8db937221c4a5b033352524d70d7cde13bdb98724b66467a74
  Stored in directory: /Users/lurongming/Library/Caches/pip/wheels/94/48/e5/d944e616d8b0734c3b9cf30a21f4afcf855a1e2b85f82f34fb
Successfully built readability-lxml
Installing c
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值