V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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
Waihinchan
V2EX  ›  Python

bs4 select 能用正则表达式吗?

  •  
  •   Waihinchan · Sep 25, 2019 · 3985 views
    This topic created in 2412 days ago, the information mentioned may be changed or developed.

    如题。 我看到 find_all 是可以用正则表达式的。 如果我想用 soup.select 用正则表达式去匹配 id 的话,应该怎么操作呢?

    3 replies    2019-09-25 08:45:24 +08:00
    AX5N
        2
    AX5N  
       Sep 25, 2019
    一般来说这些库都会忠实还原原本应有的功能,原本能支持正则就能支持正则,原本不能支持就不能支持。
    lake325
        3
    lake325  
       Sep 25, 2019 via iPhone
    query 语句不就可以吗,为何非要用正则呢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2310 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 01:33 · PVG 09:33 · LAX 18:33 · JFK 21:33
    ♥ Do have faith in what you're doing.