HTML parsing and extraction helpers for Vibe.Plugins.WebSearch.
This module intentionally delegates HTML parsing to Floki. It does not parse HTML with regular expressions.
Summary
Functions
Parses HTML from a fetch result or binary string with Floki.
Parses HTML with Floki and raises when parsing fails.
Returns raw HTML for nodes matching a CSS selector.
Converts HTML to Markdown using a small Floki-tree renderer.
Converts HTML to plain text using Floki.
Types
@type html_tree() :: Floki.html_tree()
Functions
@spec parse(Vibe.Plugins.WebSearch.FetchResult.t() | String.t()) :: {:ok, html_tree()} | {:error, term()}
Parses HTML from a fetch result or binary string with Floki.
@spec parse!(Vibe.Plugins.WebSearch.FetchResult.t() | String.t()) :: html_tree()
Parses HTML with Floki and raises when parsing fails.
@spec select_html( Vibe.Plugins.WebSearch.FetchResult.t() | String.t() | html_tree(), String.t() ) :: {:ok, String.t()} | {:error, term()}
Returns raw HTML for nodes matching a CSS selector.
@spec to_markdown(Vibe.Plugins.WebSearch.FetchResult.t() | String.t() | html_tree()) :: {:ok, String.t()} | {:error, term()}
Converts HTML to Markdown using a small Floki-tree renderer.
@spec to_text(Vibe.Plugins.WebSearch.FetchResult.t() | String.t() | html_tree()) :: {:ok, String.t()} | {:error, term()}
Converts HTML to plain text using Floki.