百度屏蔽了indy的客户端标识的 Mozilla/3.0 (compatible; Indy Library),把‘Indy Library’去掉就可以了。
try IdHTTP1.Request.UserAgent := 'Mozilla/3.0 (compatible;)'; aStr := IdHTTP1.Get('http://www.baidu.com'); except end;
完整的:
‘Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)’