想做個抓取網頁的程式。試驗中。
IdHTTP->ProtocolVersion=pv1_1;
IdHTTP->Request->Accept="text/html,application/xhtml+xml,*/*";
IdHTTP->Request->AcceptLanguage="zh-CN";
IdHTTP->Request->UserAgent="Mozilla/5.0(Windows NT 6.1;Trident/7.0;BOIE9;ZHCN;rv:11.0)like Gecko";
IdHTTP->Request->AcceptEncoding="gzip,deflate";
IdHTTP->Request->Host="www.w3school.com.cn";
IdHTTP->Request->CustomHeaders->Values["DNT"]="1";
IdHTTP->Request->Connection="Keep-Alive";
IdHTTP->Get("http://www.w3school.com.cn/");
Memo1->Lines->Add(IdHTTP->Request->RawHeaders->Text);
Memo1->Lines->Add("");
Memo1->Lines->Add(IdHTTP->ResponseText);
Memo1->Lines->Add(IdHTTP->Response->RawHeaders->Text);
fiddler 已經顯示有回傳的資訊。
接下來顯示回傳內容怎樣寫? 跪求!!!!!!!!!!!!!!
uj5u.com熱心網友回復:
抓取網頁內容,就下面一句就夠了
Memo1->Lines->Text=IdHTTP1->Get("http://www.w3school.com.cn");
uj5u.com熱心網友回復:
delphi IDHttp的基本用法https://blog.csdn.net/chinajobs/article/details/51442308
uj5u.com熱心網友回復:
改成www.baidu.com就直接例外了。轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/35812.html
標籤:網絡及通訊開發
上一篇:python遍歷指定路徑下所有檔案,并按照時間區間檢索
下一篇:求大佬幫幫小白解決這道C語言題
