参考:
http://www.linuxdiyf.com/linux/2800.html
http://dbajun.iteye.com/blog/1813801
测试访问网页:
[zabbix@zabbix server]$ curl www.baidu.com
<!DOCTYPE html><!--STATUS OK--><html><head><meta http-equiv="content-type" content="text/html;charset=utf-8"><meta http-equiv="X-UA-Compatible" content="IE=Edge"><meta content="always" name="referrer">
...
...
'result_form':"#form",'result_kw':"#kw"});</script><script>if(navigator.cookieEnabled){document.cookie="NOJS=;expires=Sat, 01 Jan 2000 00:00:00 GMT";}</script></body></html>
[zabbix@zabbix server]$
路径访问:
[zabbix@zabbix server]$ curl http://donald-draper.iteye.com/admin/blogs/2316699
<html><body>You are being <a href="http://www.iteye.com/login">redirected</a>.</body></html>[zabbix@zabbix server]$
带参数:
[zabbix@zabbix server]$ curl http://192.168.126.128/zabbix/dashboard.php?sid=9422e571896006a3
<!doctype html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<title>zabbixServer: Dashboard</title>
<meta name="Author" content="Zabbix SIA" />
<meta charset="utf-8" />
<meta name="msapplication-config" content="none"/>
<link rel="shortcut icon" href="images/general/zabbix.ico" />
....
.....
hat_lastiss":{"frequency":60,"url":'?output=html',"counter":0,"darken":0,"params":{"favobj":'hat',"favref":'hat_lastiss',"favaction":'refresh'}},"hat_webovr":{"frequency":60,"url":'?output=html',"counter":0,"darken":0,"params":{"favobj":'hat',"favref":'hat_webovr',"favaction":'refresh'}},"hat_hoststat":{"frequency":60,"url":'?output=html',"counter":0,"darken":0,"params":{"favobj":'hat',"favref":'hat_hoststat',"favaction":'refresh'}}});
jqBlink.blink();
cookie.init();
chkbxRange.init();
});
// ]]></script></body>
</html>
[zabbix@zabbix server]$
测试保存网页命令
[zabbix@zabbix server]$ curl -o baidu.html www.baidu.com
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 99583 0 99583 0 0 31378 0 --:--:-- 0:00:03 --:--:-- 31374
[zabbix@zabbix server]$ ls -al
total 2092
-rw-rw-r-- 1 zabbix zabbix 99583 Aug 10 17:33 baidu.html
Linux curl命令
猜你喜欢
转载自donald-draper.iteye.com/blog/2316699
今日推荐
周排行