[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-6460":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":33,"readmeContent":34,"aiSummary":35,"trendingCount":16,"starSnapshotCount":16,"syncStatus":36,"lastSyncTime":37,"discoverSource":38},6460,"nokogiri","sparklemotion\u002Fnokogiri","sparklemotion","Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby.","https:\u002F\u002Fnokogiri.org\u002F",null,"C",6268,938,147,74,0,1,15,39.92,"MIT License",false,"main",true,[25,26,5,27,28,29,30,31,32],"libxml2","libxslt","ruby","ruby-gem","sax","xerces","xml","xslt","2026-06-12 02:01:25","\u003Cdiv>\u003Cimg src=\"https:\u002F\u002Fnokogiri.org\u002Fimages\u002Fnokogiri-serif-black.png\" align=\"right\"\u002F>\u003C\u002Fdiv>\n\n# Nokogiri\n\nNokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby. It provides a sensible, easy-to-understand API for [reading](https:\u002F\u002Fnokogiri.org\u002Ftutorials\u002Fparsing_an_html_xml_document.html), writing, [modifying](https:\u002F\u002Fnokogiri.org\u002Ftutorials\u002Fmodifying_an_html_xml_document.html), and [querying](https:\u002F\u002Fnokogiri.org\u002Ftutorials\u002Fsearching_a_xml_html_document.html) documents. It is fast and standards-compliant by relying on native parsers like libxml2, libgumbo, and xerces.\n\n## Guiding Principles\n\nSome guiding principles Nokogiri tries to follow:\n\n- be secure-by-default by treating all documents as **untrusted** by default\n- be a **thin-as-reasonable layer** on top of the underlying parsers, and don't attempt to fix behavioral differences between the parsers\n\n\n## Features Overview\n\n- DOM Parser for XML, HTML4, and HTML5\n- SAX Parser for XML and HTML4\n- Push Parser for XML and HTML4\n- Document search via XPath 1.0\n- Document search via CSS3 selectors, with some jquery-like extensions\n- XSD Schema validation\n- XSLT transformation\n- \"Builder\" DSL for XML and HTML documents\n\n\n## Status\n\n[![Github Actions CI](https:\u002F\u002Fgithub.com\u002Fsparklemotion\u002Fnokogiri\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg?branch=main)](https:\u002F\u002Fgithub.com\u002Fsparklemotion\u002Fnokogiri\u002Factions\u002Fworkflows\u002Fci.yml)\n[![Appveyor CI](https:\u002F\u002Fci.appveyor.com\u002Fapi\u002Fprojects\u002Fstatus\u002Fxj2pqwvlxwuwgr06\u002Fbranch\u002Fmain?svg=true)](https:\u002F\u002Fci.appveyor.com\u002Fproject\u002Fflavorjones\u002Fnokogiri\u002Fbranch\u002Fmain)\n\n[![Gem Version](https:\u002F\u002Fbadge.fury.io\u002Frb\u002Fnokogiri.svg)](https:\u002F\u002Frubygems.org\u002Fgems\u002Fnokogiri)\n[![SemVer compatibility](https:\u002F\u002Fdependabot-badges.githubapp.com\u002Fbadges\u002Fcompatibility_score?dependency-name=nokogiri&package-manager=bundler&previous-version=1.11.7&new-version=1.12.5)](https:\u002F\u002Fdocs.github.com\u002Fen\u002Fcode-security\u002Fsupply-chain-security\u002Fmanaging-vulnerabilities-in-your-projects-dependencies\u002Fabout-dependabot-security-updates#about-compatibility-scores)\n\n[![CII Best Practices](https:\u002F\u002Fbestpractices.coreinfrastructure.org\u002Fprojects\u002F5344\u002Fbadge)](https:\u002F\u002Fbestpractices.coreinfrastructure.org\u002Fprojects\u002F5344)\n[![Tidelift dependencies](https:\u002F\u002Ftidelift.com\u002Fbadges\u002Fpackage\u002Frubygems\u002Fnokogiri)](https:\u002F\u002Ftidelift.com\u002Fsubscription\u002Fpkg\u002Frubygems-nokogiri?utm_source=rubygems-nokogiri&utm_medium=referral&utm_campaign=readme)\n\n\n## Support, Getting Help, and Reporting Issues\n\nAll official documentation is posted at https:\u002F\u002Fnokogiri.org (the source for which is at https:\u002F\u002Fgithub.com\u002Fsparklemotion\u002Fnokogiri.org\u002F, and we welcome contributions).\n\n### Reading\n\nYour first stops for learning more about Nokogiri should be:\n\n- [API Documentation](https:\u002F\u002Fnokogiri.org\u002Frdoc\u002Findex.html)\n- [Tutorials](https:\u002F\u002Fnokogiri.org\u002Ftutorials\u002Ftoc.html)\n- An excellent community-maintained [Cheat Sheet](https:\u002F\u002Fgithub.com\u002Fsparklemotion\u002Fnokogiri\u002Fwiki\u002FCheat-sheet)\n\n\n### Ask For Help\n\nThere are a few ways to ask exploratory questions:\n\n- The Nokogiri mailing list is active at https:\u002F\u002Fgroups.google.com\u002Fgroup\u002Fnokogiri-talk\n- Open an issue using the \"Help Request\" template at https:\u002F\u002Fgithub.com\u002Fsparklemotion\u002Fnokogiri\u002Fissues\n- Open a discussion at https:\u002F\u002Fgithub.com\u002Fsparklemotion\u002Fnokogiri\u002Fdiscussions\n\nPlease do not mail the maintainers at their personal addresses.\n\n\n### Report A Bug\n\nThe Nokogiri bug tracker is at https:\u002F\u002Fgithub.com\u002Fsparklemotion\u002Fnokogiri\u002Fissues\n\nPlease use the \"Bug Report\" or \"Installation Difficulties\" templates.\n\n\n### Security and Vulnerability Reporting\n\nPlease report vulnerabilities at https:\u002F\u002Fgithub.com\u002Fsparklemotion\u002Fnokogiri\u002Fsecurity\n\nSee [SECURITY.md](SECURITY.md) for full information and description of our security policy.\n\n\n### Semantic Versioning Policy\n\nNokogiri follows [Semantic Versioning](https:\u002F\u002Fsemver.org\u002F) (since 2017 or so). [![Dependabot's SemVer compatibility score for Nokogiri](https:\u002F\u002Fdependabot-badges.githubapp.com\u002Fbadges\u002Fcompatibility_score?dependency-name=nokogiri&package-manager=bundler&previous-version=1.11.7&new-version=1.12.5)](https:\u002F\u002Fdocs.github.com\u002Fen\u002Fcode-security\u002Fsupply-chain-security\u002Fmanaging-vulnerabilities-in-your-projects-dependencies\u002Fabout-dependabot-security-updates#about-compatibility-scores)\n\nWe bump `Major.Minor.Patch` versions following this guidance:\n\n`Major`: (we've never done this)\n\n- Significant backwards-incompatible changes to the public API that would require rewriting existing application code.\n\n`Minor`:\n\n- Features and bugfixes.\n- Updating packaged libraries for non-security-related reasons.\n- Dropping support for EOLed Ruby versions. [Some folks find this objectionable](https:\u002F\u002Fgithub.com\u002Fsparklemotion\u002Fnokogiri\u002Fissues\u002F1568), but [SemVer says this is OK if the public API hasn't changed](https:\u002F\u002Fsemver.org\u002F#what-should-i-do-if-i-update-my-own-dependencies-without-changing-the-public-api).\n- Backwards-incompatible changes to internal or private methods and constants. These are detailed in the \"Changes\" section of each changelog entry.\n- Removal of deprecated methods or parameters, after a generous transition period; usually when those methods or parameters are rarely-used or dangerous to the user. Essentially, removals that do not justify a major version bump.\n\n\n`Patch`:\n\n- Bugfixes.\n- Security updates.\n- Updating packaged libraries for security-related reasons.\n\n\n### Sponsorship\n\nYou can help sponsor the maintainers of this software through one of these organizations:\n\n- [github.com\u002Fsponsors\u002Fflavorjones](https:\u002F\u002Fgithub.com\u002Fsponsors\u002Fflavorjones)\n- [opencollective.com\u002Fnokogiri](https:\u002F\u002Fopencollective.com\u002Fnokogiri)\n- [tidelift.com\u002Fsubscription\u002Fpkg\u002Frubygems-nokogiri](https:\u002F\u002Ftidelift.com\u002Fsubscription\u002Fpkg\u002Frubygems-nokogiri?utm_source=rubygems-nokogiri&utm_medium=referral&utm_campaign=readme)\n\n\n## Installation\n\nRequirements:\n\n- Ruby >= 3.2\n- JRuby >= 10.0\n\nIf you are compiling the native extension against a system version of libxml2:\n\n- libxml2 >= 2.9.2 (recommended >= 2.12.0)\n\n\n### Native Gems: Faster, more reliable installation\n\n\"Native gems\" contain pre-compiled libraries for a specific machine architecture. On supported platforms, this removes the need for compiling the C extension and the packaged libraries, or for system dependencies to exist. This results in **much faster installation** and **more reliable installation**, which as you probably know are the biggest headaches for Nokogiri users.\n\n### Supported Platforms\n\nNokogiri ships pre-compiled, \"native\" gems for the following platforms:\n\n- Linux:\n  - `x86_64-linux-gnu`, `aarch64-linux-gnu`, and `arm-linux-gnu` (req: `glibc >= 2.29`)\n  - `x86_64-linux-musl`, `aarch64-linux-musl`, and `arm-linux-musl`\n- Darwin\u002FMacOS: `x86_64-darwin` and `arm64-darwin`\n- Windows: `x64-mingw-ucrt`\n- Java: any platform running JRuby 10.0 or higher\n\nTo determine whether your system supports one of these gems, look at the output of `bundle platform` or `ruby -e 'puts Gem::Platform.local.to_s'`.\n\nIf you're on a supported platform, either `gem install` or `bundle install` should install a native gem without any additional action on your part. This installation should only take a few seconds, and your output should look something like:\n\n``` sh\n$ gem install nokogiri\nFetching nokogiri-1.11.0-x86_64-linux.gem\nSuccessfully installed nokogiri-1.11.0-x86_64-linux\n1 gem installed\n```\n\n\n### Other Installation Options\n\nBecause Nokogiri is a C extension, it requires that you have a C compiler toolchain, Ruby development header files, and some system dependencies installed.\n\nThe following may work for you if you have an appropriately-configured system:\n\n``` bash\ngem install nokogiri\n```\n\nIf you have any issues, please visit [Installing Nokogiri](https:\u002F\u002Fnokogiri.org\u002Ftutorials\u002Finstalling_nokogiri.html) for more complete instructions and troubleshooting.\n\n\n## How To Use Nokogiri\n\nNokogiri is a large library, and so it's challenging to briefly summarize it. We've tried to provide long, real-world examples at [Tutorials](https:\u002F\u002Fnokogiri.org\u002Ftutorials\u002Ftoc.html).\n\n### Parsing and Querying\n\nHere is example usage for parsing and querying a document:\n\n```ruby\n#! \u002Fusr\u002Fbin\u002Fenv ruby\n\nrequire 'nokogiri'\nrequire 'open-uri'\n\n# Fetch and parse HTML document\ndoc = Nokogiri::HTML(URI.open('https:\u002F\u002Fnokogiri.org\u002Ftutorials\u002Finstalling_nokogiri.html'))\n\n# Search for nodes by css\ndoc.css('nav ul.menu li a', 'article h2').each do |link|\n  puts link.content\nend\n\n# Search for nodes by xpath\ndoc.xpath('\u002F\u002Fnav\u002F\u002Ful\u002F\u002Fli\u002Fa', '\u002F\u002Farticle\u002F\u002Fh2').each do |link|\n  puts link.content\nend\n\n# Or mix and match\ndoc.search('nav ul.menu li a', '\u002F\u002Farticle\u002F\u002Fh2').each do |link|\n  puts link.content\nend\n```\n\n\n### Encoding\n\nStrings are always stored as UTF-8 internally.  Methods that return\ntext values will always return UTF-8 encoded strings.  Methods that\nreturn a string containing markup (like `to_xml`, `to_html` and\n`inner_html`) will return a string encoded like the source document.\n\n__WARNING__\n\nSome documents declare one encoding, but actually use a different\none. In these cases, which encoding should the parser choose?\n\nData is just a stream of bytes. Humans add meaning to that stream. Any\nparticular set of bytes could be valid characters in multiple\nencodings, so detecting encoding with 100% accuracy is not\npossible. `libxml2` does its best, but it can't be right all the time.\n\nIf you want Nokogiri to handle the document encoding properly, your\nbest bet is to explicitly set the encoding.  Here is an example of\nexplicitly setting the encoding to EUC-JP on the parser:\n\n```ruby\n  doc = Nokogiri.XML('\u003Cfoo>\u003Cbar \u002F>\u003C\u002Ffoo>', nil, 'EUC-JP')\n```\n\n\n## Technical Overview\n\n### Guiding Principles\n\nAs noted above, two guiding principles of the software are:\n\n- be secure-by-default by treating all documents as **untrusted** by default\n- be a **thin-as-reasonable layer** on top of the underlying parsers, and don't attempt to fix behavioral differences between the parsers\n\nNotably, despite all parsers being standards-compliant, there are behavioral inconsistencies between the parsers used in the CRuby and JRuby implementations, and Nokogiri does not and should not attempt to remove these inconsistencies. Instead, we surface these differences in the test suite when they are important\u002Fsemantic; or we intentionally write tests to depend only on the important\u002Fsemantic bits (omitting whitespace from regex matchers on results, for example).\n\n\n### CRuby\n\nThe Ruby (a.k.a., CRuby, MRI, YARV) implementation is a C extension that depends on libxml2 and libxslt (which in turn depend on zlib and possibly libiconv).\n\nThese dependencies are met by default by Nokogiri's packaged versions of the libxml2 and libxslt source code, but a configuration option `--use-system-libraries` is provided to allow specification of alternative library locations. See [Installing Nokogiri](https:\u002F\u002Fnokogiri.org\u002Ftutorials\u002Finstalling_nokogiri.html) for full documentation.\n\nWe provide native gems by pre-compiling libxml2 and libxslt (and potentially zlib and libiconv) and packaging them into the gem file. In this case, no compilation is necessary at installation time, which leads to faster and more reliable installation.\n\nSee [LICENSE-DEPENDENCIES.md](LICENSE-DEPENDENCIES.md) for more information on which dependencies are provided in which native and source gems.\n\n\n### JRuby\n\nThe Java (a.k.a. JRuby) implementation is a Java extension that depends primarily on Xerces and NekoHTML for parsing, though additional dependencies are on `isorelax`, `nekodtd`, `jing`, `serializer`, `xalan-j`, and `xml-apis`.\n\nThese dependencies are provided by pre-compiled jar files packaged in the `java` platform gem.\n\nSee [LICENSE-DEPENDENCIES.md](LICENSE-DEPENDENCIES.md)\nfor more information on which dependencies are provided in which native and source gems.\n\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for an intro guide to developing Nokogiri.\n\n\n## Code of Conduct\n\nSee the [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md).\n\n\n## License\n\nThis project is licensed under the terms of the MIT license.\n\nSee [LICENSE.md](LICENSE.md).\n\n\n### Dependencies\n\nSome additional libraries may be distributed with your version of Nokogiri.\nSee [LICENSE-DEPENDENCIES.md](LICENSE-DEPENDENCIES.md) for a discussion of the variations as well as the licenses thereof.\n\n\n## Authors\n\n- Mike Dalessio\n- Aaron Patterson\n- Yoko Harada\n- Akinori MUSHA\n- John Shahid\n- Karol Bucek\n- Sam Ruby\n- Craig Barnes\n- Stephen Checkoway\n- Lars Kanis\n- Sergio Arbeo\n- Timothy Elliott\n- Nobuyoshi Nakada\n\n\n## Sponsors\n\nThese folks have generously sponsored Nokogiri's development. Thank you for your support!\n\n\u003Cp class=\"sponsors\">\n  \u003Cspan style=\"white-space: nowrap;\">\u003Ca href=\"https:\u002F\u002Fsentry.io\">\u003Cimg src=\"https:\u002F\u002Fnokogiri.org\u002Fimages\u002Fsponsors\u002Fsentry-icon.png\" alt=\"Sentry\" height=\"44\" style=\"vertical-align: middle;\">\u003C\u002Fa>&nbsp;\u003Cb>Sentry\u003C\u002Fb>\u003C\u002Fspan>\n  &nbsp;&nbsp;&nbsp;&nbsp;\n  \u003Cspan style=\"white-space: nowrap;\">\u003Ca href=\"https:\u002F\u002Fcodecov.io\">\u003Cimg src=\"https:\u002F\u002Fnokogiri.org\u002Fimages\u002Fsponsors\u002Fcodecov-icon.png\" alt=\"Codecov\" height=\"44\" style=\"vertical-align: middle;\">\u003C\u002Fa>&nbsp;\u003Cb>Codecov\u003C\u002Fb>\u003C\u002Fspan>\n  &nbsp;&nbsp;&nbsp;&nbsp;\n  \u003Cspan style=\"white-space: nowrap;\">\u003Ca href=\"https:\u002F\u002Fgusto.com\">\u003Cimg src=\"https:\u002F\u002Fnokogiri.org\u002Fimages\u002Fsponsors\u002Fgusto-icon.png\" alt=\"Gusto\" height=\"44\" style=\"vertical-align: middle;\">\u003C\u002Fa>&nbsp;\u003Cb>Gusto\u003C\u002Fb>\u003C\u002Fspan>\n  &nbsp;&nbsp;&nbsp;&nbsp;\n  \u003Cspan style=\"white-space: nowrap;\">\u003Ca href=\"https:\u002F\u002Fhasdata.com\">\u003Cimg src=\"https:\u002F\u002Fnokogiri.org\u002Fimages\u002Fsponsors\u002Fhasdata-icon.png\" alt=\"HasData\" height=\"44\" style=\"vertical-align: middle;\">\u003C\u002Fa>&nbsp;\u003Cb>HasData\u003C\u002Fb>\u003C\u002Fspan>\n\u003C\u002Fp>\n","Nokogiri 是一个让 Ruby 开发者能够轻松处理 XML 和 HTML 的库。它提供了一套直观易懂的 API，支持文档的读取、写入、修改和查询，并通过依赖 libxml2 等原生解析器来保证高性能与标准兼容性。Nokogiri 旨在成为底层解析器之上的尽可能薄的一层封装，不试图修正不同解析器间的行为差异，同时默认将所有文档视为不可信以确保安全性。该库具备 DOM、SAX 和 Push 解析器，支持 XPath 1.0 和 CSS3 选择器进行文档搜索，以及 XSD 验证、XSLT 转换等功能。适用于需要高效处理结构化数据或网页抓取等场景下的 Ruby 应用开发。",2,"2026-06-11 03:07:06","top_language"]