gpt4 book ai didi

ruby - Nokogiri:查找没有类属性的节点的第一次出现

转载 作者:太空宇宙 更新时间:2023-11-03 17:16:54 24 4
gpt4 key购买 nike

在下面的代码片段中,我想获取第一个没有类属性的 标签。

<html>
<body>
<p>This is the <b class="abc">text in bold with a class attribute</b> and the following is <b> text in bold without a class attribute</b>
</body>
</html>

有什么建议吗?

最佳答案

那就是:

doc.at('b:not([class])')

关于ruby - Nokogiri:查找没有类属性的节点的第一次出现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14979849/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com