delphi 网页数据抓取


本文整理自网络,侵删。

 方法一:
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://www.14a.cn/';
  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);

相关阅读 >>

Delphi 24位真彩色图形转化为ico文件

Delphi inttohex

Delphi的tstreamreader逐行读取文本文件

Delphi twebbrowser get html source after ajax load

Delphi中break,exit,abort跳出循环的比较

Delphi tstringlist indexof find 查找字符串

Delphi 用正则表达式获取指定的字符串续取出所有符合要求的字符串

Delphi thttpclient 时获取跳转后的 url

Delphi unigui确认对话框

Delphi 10.3.x 截取字符串函数substring 和copy()常用字串符处理函数用法

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...