All Projects → craigbarnes → Lua Gumbo

craigbarnes / Lua Gumbo

Licence: apache-2.0
Moved to https://gitlab.com/craigbarnes/lua-gumbo

Programming Languages

c
50402 projects - #5 most used programming language
lua
6591 projects

Projects that are alternatives of or similar to Lua Gumbo

Html5 Dom Document Php
A better HTML5 parser for PHP.
Stars: ✭ 477 (+311.21%)
Mutual labels:  parser, html5, dom
Curtainsjs
curtains.js is a lightweight vanilla WebGL javascript library that turns HTML DOM elements into interactive textured planes.
Stars: ✭ 1,039 (+795.69%)
Mutual labels:  html5, dom
Html React Parser
📝 HTML to React parser.
Stars: ✭ 846 (+629.31%)
Mutual labels:  parser, dom
Web Template
web-template.js 是一款基于 ES6 模板字符串解析的模板引擎。
Stars: ✭ 67 (-42.24%)
Mutual labels:  html5, dom
Cheerio
Fast, flexible, and lean implementation of core jQuery designed specifically for the server.
Stars: ✭ 24,616 (+21120.69%)
Mutual labels:  parser, dom
Slim.js
Fast & Robust Front-End Micro-framework based on modern standards
Stars: ✭ 789 (+580.17%)
Mutual labels:  html5, dom
Scalajs Bootstrap
Scala.js bootstrap components
Stars: ✭ 55 (-52.59%)
Mutual labels:  html5, dom
Anglesharp
👼 The ultimate angle brackets parser library parsing HTML5, MathML, SVG and CSS to construct a DOM based on the official W3C specifications.
Stars: ✭ 4,018 (+3363.79%)
Mutual labels:  parser, dom
Anglesharp.js
👼 Extends AngleSharp with a .NET-based JavaScript engine.
Stars: ✭ 68 (-41.38%)
Mutual labels:  parser, dom
Sequential
An environment to visualize JavaScript code execution in a browser
Stars: ✭ 74 (-36.21%)
Mutual labels:  parser, html5
Save For Offline
Android app for saving webpages for offline reading.
Stars: ✭ 114 (-1.72%)
Mutual labels:  parser, html-parser
Html Parser
php html parser,类似与PHP Simple HTML DOM Parser,但是比它快好几倍
Stars: ✭ 510 (+339.66%)
Mutual labels:  parser, html-parser
Hyntax
Straightforward HTML parser for JavaScript
Stars: ✭ 84 (-27.59%)
Mutual labels:  html-parser, dom
Fuzi
A fast & lightweight XML & HTML parser in Swift with XPath & CSS support
Stars: ✭ 894 (+670.69%)
Mutual labels:  parser, html-parser
Latex.js
JavaScript LaTeX to HTML5 translator
Stars: ✭ 374 (+222.41%)
Mutual labels:  parser, html5
Gomponents
Declarative view components in Go, that can render to HTML5.
Stars: ✭ 49 (-57.76%)
Mutual labels:  html5, dom
Frontendwingman
Frontend Wingman, Learn frontend faster!
Stars: ✭ 315 (+171.55%)
Mutual labels:  html5, dom
Selectolax
Python binding to Modest engine (fast HTML5 parser with CSS selectors).
Stars: ✭ 368 (+217.24%)
Mutual labels:  parser, html5
Oga
Read-only mirror of https://gitlab.com/yorickpeterse/oga
Stars: ✭ 1,147 (+888.79%)
Mutual labels:  parser, html-parser
Hpq
Utility to parse and query HTML into an object shape
Stars: ✭ 82 (-29.31%)
Mutual labels:  parser, dom

Synopsis

lua-gumbo is a HTML5 parser and DOM library for Lua. It originally started out as a set of Lua bindings for the Gumbo C library, but has now absorbed an improved fork of it.

Requirements

Installation

To install the latest release via LuaRocks use the command:

luarocks install gumbo

Usage

The gumbo module provides a parse function and a parseFile function, which both return a Document node containing a tree of descendant nodes. The structure and API of this tree mostly follows the DOM Level 4 Core specification.

For full API documentation, see: https://craigbarnes.gitlab.io/lua-gumbo/.

Example

The following is a simple demonstration of how to find an element by ID and print the contents of it's first child text node.

local gumbo = require "gumbo"
local document = gumbo.parse('<div id="foo">Hello World</div>')
local foo = document:getElementById("foo")
local text = foo.childNodes[1].data
print(text) --> Hello World

Note: this example omits error handling for the sake of simplicity. Production code should wrap each step with assert() or some other, application-specific error handling.

See also: https://craigbarnes.gitlab.io/lua-gumbo/#examples.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].