-
nokolexbor
High-performance HTML5 parser for Ruby based on Lexbor, with support for both CSS selectors and XPath.
You can also switch to Nokolexbor, our drop-in replacement for Nokogiri: https://github.com/serpapi/nokolexbor
It should almost 1,000 faster for this kind of CSS lookups.
-
CodeRabbit
CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
-
You may also be interested in https://github.com/gjtorikian/html-pipeline (or its main dependency, https://github.com/gjtorikian/selma), for high performance HTML manipulation.
-
selma
Selma selects and matches HTML nodes using CSS rules. Backed by Rust's lol_html parser. (by gjtorikian)
You may also be interested in https://github.com/gjtorikian/html-pipeline (or its main dependency, https://github.com/gjtorikian/selma), for high performance HTML manipulation.
-
(2.1) Compare tagName in the selector
Apparently Nokogiri implements CSS in a very inefficient way though by collecting ancestors and then converting the CSS into xpath and matching that:
https://github.com/sparklemotion/nokogiri/blob/e8d30a71d70b2...
https://github.com/sparklemotion/nokogiri/blob/e8d30a71d70b2...
I'd expect that to be an order of magnitude slower than what a browser does.
Related posts
-
Comparable maintained Kimurai alternative?
-
In "Your Name" (2016), Mitsuha and Tesshi are seen turning a tree into their makeshift café, which is why one of the trees in the town is later missing
-
Nokogiri 1.12 supports HTML5 parsing (after assimilating Nokogumbo)
-
Error when creating a new project
-
How efficient is the Xml filter plugin with large files?