V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
V2EX  ›  CLCLCLCLCL  ›  全部回复第 4 页 / 共 4 页
回复总数  61
1  2  3  4  
❮ ❯
2021 年 3 月 25 日
回复了 2bin 创建的主题 › Python › 请教 Python 中 xpath 如何实现这种需求
html = etree.HTML(html_str)
content = html.xpath('string(//a)')

直接用 string 就行
1  2  3  4  
❮ ❯
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1311 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 9ms · UTC 19:18 · PVG 03:18 · LAX 11:18 · JFK 14:18
♥ Do have faith in what you're doing.