easyhtml
easyhtml copied to clipboard
EasyHTML makes it easy to work with HTML in Elixir.
EasyHTML
EasyHTML makes working with HTML easy.
It is a tiny wrapper around Floki that adds conveniences for HTML nodes:
- An
Inspectimplementation to pretty-print them - An
Accessimplementation to search them - A
String.Charsimplementation to convert them to text
Usage
Mix.install([
{:easyhtml, "~> 0.3.0"}
])
doc = EasyHTML.parse!("<p>Hello, <em>world</em>!</p>")
#=> ~HTML[<p>Hello, <em>world</em>!</p>]
doc["em"]
#=> ~HTML[<em>world</em>]
to_string(doc)
#=> "Hello, world!"