- 人气:
- 放大
- 缩小
- 二维码
- 赞赏
delphi TIdHTTP抓取页面信息
function MacSonucuAl(const id: Integer): string;
function SubParse(Source, L, R: string): string;
begin
Delete(Source, 1, Pos(L, Source) + Length(L) - 1);
Result := Copy(Source, 1, Pos(R, Source) - 1);
end;
var
HTTP: TIdHTTP;
Temp: string;
begin
HTTP := TIdHTTP.Create(nil);
try
Temp := HTTP.Get('http://www.delphitop.com.com/Mac/' + IntToStr(id) + '/');
Result := Trim(SubParse(Temp, '
', '
'));
finally
HTTP.Free;
end;
end;