View Source Foresight.HTML (Foresight v0.6.0)

This module contains functions to fetch HTML documents.

Summary

Functions

Takes a %HTTPoison.Response{} and returns the body, otherwise nil

Takes a URL and returns the HTML document if found.

Takes a URL, and returns a {:ok, %HTTPoison.Response{}} tuple, or {:error, reason} if something goes wrong. It follows redirects to a maximum of 5 in total. This is necessary on e.g. https://google.com

Bang! version of get_url Takes a URL, and returns a %HTTPoison.Response{} or throws an error. It follows redirects to a maximum of 5 in total. This is necessary on e.g. https://google.com

Functions

get_body(arg1)

Takes a %HTTPoison.Response{} and returns the body, otherwise nil

get_html(url)

Takes a URL and returns the HTML document if found.

get_url(url)

Takes a URL, and returns a {:ok, %HTTPoison.Response{}} tuple, or {:error, reason} if something goes wrong. It follows redirects to a maximum of 5 in total. This is necessary on e.g. https://google.com

get_url!(url)

Bang! version of get_url Takes a URL, and returns a %HTTPoison.Response{} or throws an error. It follows redirects to a maximum of 5 in total. This is necessary on e.g. https://google.com