1.delphi 循环采集网页
delphi 循环采集网页
//改了一下您的获取获代码,目前的网页网页九鲸系统源码案例是可以,取到5天的源码dlna dmr源码资料
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, MsXML, StdCtrls;
type
TForm1 = class(TForm)
Memo1: TMemo;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
function GetStr(var StrSource:string; StrBegin, StrEnd: string): string;
end;
var
Form1: TForm1;
implementation
{ $R *.dfm}
function TForm1.GetStr(var StrSource:string; StrBegin, StrEnd: string): string;
var
in_star, in_end: integer;
begin
in_star := AnsiPos(strbegin, strsource) + length(strbegin);
in_end := AnsiPos(strend, strsource);
Result := copy(strsource, in_star, in_end - in_star);
if (in_star = 0) or (in_end = 0) or (in_end < in_star) then
StrSource := ''
else
StrSource := copy(strsource, in_end+length(strend), length(strsource))
end;
procedure TForm1.FormCreate(Sender: TObject);
var
req: IXMLHTTPRequest;
SetNoteStr,ResponseStr: string;
begin
req :=CoXMLHTTPRequest.Create;
req.open('Get', '/wap/weather/.shtml', False,EmptyParam, EmptyParam);
req.send(EmptyParam);
memo1.clear;
ResponseStr := req.responseText;
while ResponseStr<>'' do
begin
SetNoteStr := GetStr(ResponseStr, '<dt>', '<br />&');//获取标签直接的代码
memo1.Lines.Add(SetNoteStr);
end;
end;
end.
暴雪对网易正式发出“分手函”后,下一个代理商将花落谁家?
Fed利率連三凍!暗示明年至少降息3次 道瓊大漲512點創新高
客人3星評論「員工長得醜,生意怎麼好」 老闆竟告知做到月底
一架搭載烏戰俘的俄軍運輸機被烏軍擊落 外交部:各方盡快停火止戰
安徽:启动2023年元旦春节食品安全“你点我检”专项服务活动
超高齡銀髮族硬舉 老人家肌力訓練沒問題嗎?