-module(page_grabber).
-export([start/0]).
start() ->
% 获取代理IP
{ok, IPResp} = httpc:request("http://api.ip.data5u.com/dynamic/get.html?order=你的提取码&sep=3"),
[IP|_] = string:tokens(IPResp, ":"),
% 使用代理IP访问目标网页
ProxySpec = {http, {IP, list_to_integer(lists:nth(2, string:tokens(IPResp, ":")))}},
{ok, PageResp} = httpc:request(get, {"http://www.bing.com", []}, [{proxy, ProxySpec}], []),
% 打印网页源码
io:format("~s~n", [PageResp]).