方法一:
WebBrowser1.Silent := True;
WebBrowser1.Navigate(URL);
repeat
Application.ProcessMessages;
until WebBrowser1.ReadyState = READYSTATE_COMPLETE;
WebBrowser1.Navigate(
'javascript:document.getElementById("detailFormid").submit();');
repeat
Application.ProcessMessages;
until WebBrowser1.ReadyState = READYSTATE_COMPLETE;
memo1.clear;
Memo1.Text:= WebBrowser1.OleObject.Document.documentElement.innerHtml;
方法二:
URL := 'http://fedex.com/Tracking';
IdHTTP := TIdHTTP.Create(Application);
IdHttp.Request.UserAgent := 'Mozilla/3.0';
IdHttp.HandleRedirects := True;
IdHTTP.ReadTimeout := cTimeOut;
Params := TStringList.Create;
Params.Add('tracknumbers=' + TrackId);
Params.Add('cntry_code=us');
Html := IdHTTP.Post(URL, Params);
返回HTML格式文本表格说明
表格标题栏定义
<table border="0" cellpadding="0" cellspacing="0" class="dataTable">
<tr>
<th>Location</th>
<th>Date</th>
<th>Local Time</th>
<th class="full">Activity</th>
</tr>
表格内的一行记录定义
<tr class="odd">
<td class="nowrap">
Botany,
Australia
</td>
<td class="nowrap">
08/01/2011
</td>
<td class="nowrap">
11:57 A.M.
</td>
<td>Delivered
</td>
</tr>