Read Web Page

From Erlang Community

[edit] Problem

You want to get the contents of a web page. Output are the list of lines from the web page.

[edit] Discussion

The ibrowse package is not an intrinsic erlang library; it can be obtained from the erlang user contribs section.

[edit] Solution

ibrowse:start().
 {ok, _StatusCode, _Headers, WebPageText} = ibrowse:send_req("http://www.google.com", [], get),
     Lines = string:tokens(WebPageText, "\n").
Erlang/OTP Projects
Personal tools