View Source Crawler.Parser.Spec behaviour (Crawler v1.5.0)

Spec for defining a parser.

Summary

Types

@type body() :: String.t()
@type opts() :: map()
@type page() :: %Crawler.Store.Page{
  body: body(),
  opts: opts(),
  processed: term(),
  url: url()
}
@type url() :: String.t()

Callbacks

@callback parse(page()) :: {:ok, page()}
@callback parse({:error, term()}) :: :ok