Crawler v1.1.1 Crawler.Parser.LinkParser

Parses links and transforms them if necessary.

Link to this section Summary

Functions

Parses links and transforms them if necessary.

Link to this section Functions

Link to this function

parse(arg, opts, link_handler)

Parses links and transforms them if necessary.

Examples

iex> LinkParser.parse(
iex>   {"a", [{"hello", "world"}, {"href", "http://hello.world"}], []},
iex>   %{},
iex>   &Kernel.inspect(&1, Enum.into(&2, []))
iex> )
"{\"href\", \"http://hello.world\"}"

iex> LinkParser.parse(
iex>   {"img", [{"hello", "world"}, {"src", "http://hello.world"}], []},
iex>   %{},
iex>   &Kernel.inspect(&1, Enum.into(&2, []))
iex> )
"{\"src\", \"http://hello.world\"}"