今天需要用curl測試服務器,用的是python調用的,最后發現結果中包含一些統計信息。
# -*- coding:UTF-8-*-
import os
os.system('curl http://www.baidu.com')
結果為:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2381 100 2381 0 0 25963 0 --:--:-- --:--:-- --:--:-- 25880
<!DOCTYPE html>
....
經過查找,需要添加一個參數-s
,可以去除這些統計信息。
curl http://www.baidu.com -s