【问题标题】:What's the difference between .at_css to .css in Nokogiri?Nokogiri 中的 .at_css 和 .css 有什么区别?
【发布时间】:2011-07-16 00:18:08
【问题描述】:

我找不到明确、直接的答案,但是 Nokogiri 中的 .at_css.css 有什么区别?

【问题讨论】:

    标签: ruby search nokogiri


    【解决方案1】:

    Nokogiri 有 search-and-find-everything 和 find-the-first-one 方法的同义词。

    search/xpathcss 都搜索访问器的每个出现并返回 NodeSet

    at%at_xpathat_css 搜索第一个匹配项并返回 Node。这就是为什么文档说它们相当于说search('//some/path').firstcss('some path').first

    【讨论】:

    • 谢谢,现在更有意义了:)
    猜你喜欢
    • 2016-05-01
    • 2018-03-06
    • 2015-09-30
    • 1970-01-01
    • 1970-01-01
    • 2014-07-08
    • 2011-10-16
    • 2014-08-17
    • 2011-10-21
    相关资源
    最近更新 更多