我正在寻找Nokogiri::CSS.xpath_for()
.
我找到了 css2xpath,但是 Nokogiri 的结果确实有效,而 css2xpath 返回的选择器无效。
我正在寻找的结果将是这样的:
["//div[@id = 'my_div']//*[position() = 1 and self::table]//*[position() = 1 and self::tbody]//*[position() = 2 and self::tr]//*[position() = 1 and self::td]//*[position() = 1 and self::table]//*[position() = 1 and self::tbody]//*[position() = 2 and self::tr]//*[position() = 2 and self::td]"]