View Source Pages.Html (Pages v0.1.0)

Heplful test functions for HTML. Mostly delegates to Floki

Link to this section Summary

Link to this section Types

@type attr() :: binary() | atom()
@type html() :: binary() | Pages.Driver.t() | Floki.html_tree()
@type query() :: binary() | keyword() | atom()
@type scope() :: :all | :first | :first!

Link to this section Functions

Link to this function

attr(html, attr, scope, query)

View Source
@spec attr(html(), attr(), scope(), query()) :: binary() | [binary()]
Link to this function

data(html, data_attr, scope, query)

View Source
@spec data(html(), attr(), scope(), query()) :: binary() | [binary()]
Link to this function

find(html, scope, query, fun \\ &Function.identity/1)

View Source
@spec find(html(), scope(), query(), (... -> any())) :: Floki.html_tree()
Link to this function

form_fields(html, query)

View Source
@spec form_fields(html(), query()) :: map()
Link to this function

inspect_html(html, label \\ "INSPECTED HTML")

View Source
@spec inspect_html(html(), binary()) :: html()
@spec meta_tags(html()) :: [map()]
@spec normalize(html()) :: binary()
@spec parse(html()) :: Floki.html_tree()
@spec parse_doc(binary()) :: Floki.html_tree()
@spec pretty(html()) :: binary()
Link to this function

text(html, scope, query)

View Source
@spec text(html(), scope(), query()) :: binary() | [binary()]
@spec tid(html(), scope(), query()) :: nil | binary() | [binary()]