Nokogiri::HTML4::Document < Nokogiri::XML::Document (from /home/chedong/.local/share/rdoc)
| Use Case | Command | Description |
|---|---|---|
| Parse HTML string | Nokogiri::HTML4::Document.parse(html_string) | Parses an HTML string into a document |
| Parse HTML file | Nokogiri::HTML4::Document.parse(File.read(path)) | Parses an HTML file into a document |
| Get document title | doc.title | Returns the <title> content |
| Set document title | doc.title = "new title" | Sets the <title> content |
| Get meta encoding | doc.meta_encoding | Returns encoding from meta tag |
| Set meta encoding | doc.meta_encoding = "UTF-8" | Sets encoding in meta tag |
| Serialize to HTML | doc.serialize | Serializes the document to HTML string |
| Create fragment | doc.fragment(html_string) | Creates a document fragment from HTML |
| XPath doctype | doc.xpath_doctype | Returns the DOCTYPE as XPath expression |
parse — Parses HTML source into a new documentfragment — Creates a document fragmentmeta_encoding — Gets the meta encodingmeta_encoding= — Sets the meta encodingserialize — Serializes the documenttitle — Gets the titletitle= — Sets the titlexpath_doctype — Returns the XPath doctypeGenerated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-29 00:47 @216.73.217.46
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format