Module parserino

HTML5 parser and DOM manipulation library.

Parserino is a fast html5 parser and DOM manipulation library based on the lexbor library. It's written in D and it's designed to be easy to use and fast.

import parserino;
void main()
   auto doc = Document("<html><body><p>Hello World!</p></body></html>");
   assert(doc.body.firstChild.innerText == "Hello World!");
   assert(doc.byTagName("p").front.innerText == "Hello World!");

The main two types you will use are Document and Element.


asFragment(s) Create a fragment from a string. The fragment is not attached to any document by default. The fragment is not a valid element or document, it's just a piece of html you can add to a document.
frontOr(range, fallback) Get the first element of a range or return the second args
frontOrInit(range) Get the first element of a range or return Element.init
frontOrThrow(range) Get the first element of a range or throw an exception


ChildrenElementRange A lazy range of elements
SelectorElementRange A lazy range of elements


Document The HTML5 Document
Element A html element


VisitOrder Order of visit