Description
Nokolexbor is a Ruby HTML parser that works as a drop-in replacement for Nokogiri. It is built on the Lexbor HTML5 parser and aims for an API that matches Nokogiri's as closely as possible. The project reports that it parses HTML 4.7 times faster than Nokogiri and runs CSS selectors up to 1352 times faster. It supports both CSS selectors and XPath. CSS selectors and text-node selection with ::text run on Lexbor, while XPath is handled by an engine ported from libxml2. Where the two parsers differ, the README lists the behaviors, such as how the nth-of-type selector counts elements when earlier filters are applied. Pre-compiled gems are available for common Linux, macOS and Windows platforms, so most users need no build tools. Other platforms need CMake to compile the C extensions. Nokolexbor is open source on GitHub, and the repository is under the serpapi GitHub organization.…
Highlights
- Drop-in replacement for Nokogiri's API
- Fast HTML5 parsing and CSS selectors on Lexbor
- XPath support ported from libxml2
- Text-node selection with ::text
- Pre-compiled gems for common platforms
Ratings & Reviews
No ratings yet
Be the first to rate Nokolexbor.
People also visit
Nokolexbor FAQ
Is it a drop-in replacement for Nokogiri?
The project aims for an API that is as close to 1:1 compatible with Nokogiri as possible. The README lists the places where behavior differs, such as how nth-of-type counts elements after earlier filters.
How much faster is it?
The README says it parses HTML 4.7 times faster than Nokogiri and runs CSS selectors up to 1352 times faster. These are the project's own figures.
Which platforms are supported?
Pre-compiled gems cover Linux on x86_64 and aarch64, macOS on x86_64 and arm64, and Windows on ucrt64. Other platforms need CMake to compile the C extensions.
How do I install it?
Add it to your Gemfile and run bundle install, or install the gem directly.
What are the best Nokolexbor alternatives?
Popular alternatives to Nokolexbor include Selectolax, Stealth-Requests and Dataflow kit. See all Nokolexbor alternatives










