Meeseeks.fetch_one
You're seeing just the function
fetch_one
, go back to Meeseeks module for more information.
Specs
fetch_one(queryable(), selectors()) :: {:ok, Meeseeks.Result.t()} | {:error, Meeseeks.Error.t()}
Returns {:ok, Result}
for the first node in the queryable (depth-first)
matching a selector, or
{:error, %Meeseeks.Error{type: :select, reason: :no_match}}
if none do.
Optionally accepts a Meeseeks.Context
map.
Parses the source if it is not a Meeseeks.Document
or Meeseeks.Result
,
and may return {:error, %Meeseeks.Error{type: parser}
if there is a parse
error.
If multiple selections are being ran on the same unparsed source, parse first to avoid unnecessary computation.
Examples
iex> import Meeseeks.CSS
iex> Meeseeks.fetch_one("<div id=main><p>1</p><p>2</p><p>3</p></div>", css("#main p")) |> elem(1)
#Meeseeks.Result<{ <p>1</p> }>
Specs
fetch_one(queryable(), selectors(), Meeseeks.Context.t()) :: {:ok, Meeseeks.Result.t()} | {:error, Meeseeks.Error.t()}