推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
lixuda
V2EX  ›  Python

Python 有没有好的 html 格式库

  •  
  •   lixuda · Jan 3, 2019 · 4987 views
    This topic created in 2862 days ago, the information mentioned may be changed or developed.

    网上搜了一圈没有找到合适,做下伸手党。 爬虫得到的是 html 内容,带大量各类标签及 css,id 等 attr 内容, 想通过一个库之间输出干净的 html 只保留简单的 p br img 等标签,谢谢大家

    Supplement 1  ·  Jan 3, 2019
    自己找了个,看看是否适应 bleach:一个基于白名单的 HTML 清理和文本链接库
    14 replies  •  2019-01-03 18:09:38 +08:00
    fan2006
    fan2006
    Jan 3, 2019
    1
    用过 lxml 和 beautifulsoup4.
    boom7
    boom7
    Jan 3, 2019
    2
    lxml.html.clean 试一下?
    JackeyGao
    JackeyGao
    Jan 3, 2019
    3
    不确定这个可以不可以, 试试看吧。 https://github.com/kennethreitz/requests-html
    lihongjie0209
    lihongjie0209
    Jan 3, 2019
    4
    不就是 dom 树的 变量
    lihongjie0209
    lihongjie0209
    Jan 3, 2019
    5
    变量 -> 遍历
    bytewalk
    bytewalk
    Jan 3, 2019 via iPhone
    7
    搭车问 小程序 中有没有好用的?搜了下只有 wxParse ?而且得不到有用的信息
    DawnMoon
    DawnMoon
    Jan 3, 2019 via Android
    8
    Beautiful Soup
    tabris17
    tabris17
    Jan 3, 2019
    9
    就说一个,pyquery 有坑,其他如何不清楚
    Huelse
    Huelse
    Jan 3, 2019
    10
    beautifulsoup4 容易点
    huluhulu
    huluhulu
    Jan 3, 2019 via iPhone
    11
    Beautiful Soup 很好用
    WeaponXu
    WeaponXu
    Jan 3, 2019
    12
    bs4 啊
    heiybb
    heiybb
    Jan 3, 2019 via Android
    13
    居然没人说 pyquery 嘛
    Olorin
    Olorin
    Jan 3, 2019
    14
    beautifulsoup4
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5336 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 93ms · UTC 01:57 · PVG 09:57 · LAX 17:57 · JFK 20:57
    ♥ Do have faith in what you're doing.