RosettaCodeData/Task/Web-scraping/Erlang/web-scraping.erl

11 lines
321 B
Erlang
Raw Permalink Normal View History

2013-04-11 01:07:29 -07:00
-module(scraping).
-export([main/0]).
-define(Url, "http://tycho.usno.navy.mil/cgi-bin/timer.pl").
-define(Match, "<BR>(.+ UTC)").
main() ->
2018-06-22 20:57:24 +00:00
inets:start(),
{ok, {_Status, _Header, HTML}} = httpc:request(?Url),
{match, [Time]} = re:run(HTML, ?Match, [{capture, all_but_first, binary}]),
io:format("~s~n",[Time]).