Crawler.Parser.LinkParser (Crawler v1.1.2) View Source

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)

View Source

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\"}"