抓起网页数据问题,急

wujinyuan 2008-07-11 02:52:10
var
ParaList :TStringList ;
Response :TStringStream ;
HeadURL , QryURL , s , CookieStr : String ;
i , n : integer ;
TrackState : Integer ;
FHtmlText : String;
ReTimes : Integer ; // 重试次数
s1,s2,s3 : String;
sDate,sTime : String;
MainTableMatchStr,SubTableMatchStr,TdMatchStr,TrMatchStr : String;
begin
HeadURL := 'http://www.ftexpress.com.cn/' ;
QryURL := 'http://www.ftexpress.com.cn/cgi-bin/GInfo.dll?EmmisTrack';
TrackState := 0 ;
ReTimes := 0 ;
Inc(ReTimes) ;
TrackState := 0 ;
ParaList := TStringList.Create ;
ParaList.Add('cno='+ '6002030506') ;
ParaList.Add('hdnGo=frt7bn') ;
ParaList.Add('submit.x=10') ;
ParaList.Add('submit.y=12') ;

Response := TStringStream.Create('');
// FIdHttp := TIdHttp.Create(nil) ;
try
FIdHttp.ProtocolVersion := pv1_1;
FIdHttp.Request.ContentType := 'application/x-www-form-urlencoded' ;
FIdHttp.Request.Referer := QryURL ;
FIdHttp.Request.Host := 'www.dpex.com' ;
FIdHttp.Request.ContentEncoding := 'gzip, deflate' ;
FIdHttp.Request.ContentLanguage := 'zh-cn' ;
FIdHttp.Request.Accept := 'text/html' ;
FIdHttp.ReadTimeout := 50000 ; //50 秒

try
FIdHttp.Post(QryURL ,ParaList, Response ) ;
FHtmlText := Response.DataString ;


用这种方法读起不出数据来啊。。
有没有高手帮我看看。。我 QQ 183642061 希望高手加我一下。。
...全文
77 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
wujinyuan 2008-07-17
  • 打赏
  • 举报
回复
这个网站好像不支持Get
mygodsos 2008-07-14
  • 打赏
  • 举报
回复
你去掉
try
FIdHttp.ProtocolVersion := pv1_1;
FIdHttp.Request.ContentType := 'application/x-www-form-urlencoded' ;
FIdHttp.Request.Referer := QryURL ;
FIdHttp.Request.Host := 'www.dpex.com' ;
FIdHttp.Request.ContentEncoding := 'gzip, deflate' ;
FIdHttp.Request.ContentLanguage := 'zh-cn' ;
FIdHttp.Request.Accept := 'text/html' ;
FIdHttp.ReadTimeout := 50000 ; //50 秒

用最简单的.get来看看;
FIdHttp.Get(QryURL ,Response );


要是可以,估计你的try里面这堆东西有问题
radarhp 2008-07-13
  • 打赏
  • 举报
回复
关注下
wujinyuan 2008-07-11
  • 打赏
  • 举报
回复
在多线程中利用TWebBrowser控件抓起网页上的数据。。如果有。。能不能把源代码给我看看。。
wujinyuan 2008-07-11
  • 打赏
  • 举报
回复
为什么没有来看看。。帮帮我啊。。人都快不行了。。

5,392

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧