1,593
社区成员
发帖
与我相关
我的任务
分享
procedure TForm4.Button6Click(Sender: TObject);
var
str:string;
begin
//百度屏蔽了indy的客户端标识的 Mozilla/3.0 (compatible; Indy Library),把‘Indy Library’去掉就可以了。
//IdHTTP1.Request.UserAgent:='Mozilla/3.0 (compatible; Indy Library)';
//IdHTTP1.Request.UserAgent:='Mozilla/5.0';
IdHTTP1.Request.UserAgent := 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Maxthon; .NET CLR 1.1.4322)';
Application.ProcessMessages;
//str:=IdHTTP1.Get('http://tieba.baidu.com/'); //百度主页已经使用https了
str:=IdHTTP1.Get('http://www.baidu.com/'); //百度主页已经使用https了
ShowMessage(str);
end;