unit Unit2;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StrUtils, StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP;type TForm2 = class(TForm) Button1: TButton; Ripping: TEdit; IdHTTP1: TIdHTTP; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form2: TForm2;implementation{$R *.dfm}procedure TForm2.Button1Click(Sender: TObject);const cBegin = '" rel="no">'; cBeginLen = Length(cBegin); cEnd = '</a></h2>';var i,from,search,enditem,iTemp: Integer; fromstr,st1,st2,Link,sText,itemname: String;beginst1:='728';//固定一个728编号测试from:=StrToInt(st1);st2:='728';for i := strtoint(st1) to strtoint(st2) do beginfrom:=from+1; fromstr:=inttostr(from);Link:='http://wowdb.178.com/cn/item/'+inttostr(from)+'.html'; form2.Ripping.Text:=form2.idHTTP1.Get(link); sText := form2.Ripping.text; enditem := Pos(cEnd, sText); search := Pos(cBegin, sText); while (search > 0) and (enditem > search) do begin iTemp := PosEx(cBegin,sText,search + cBeginLen); if (iTemp < 0) or (iTemp > enditem) then Break else search := iTemp; end; itemname := Copy(sText,search + cBeginLen, enditem - search - cBeginLen); ShowMessage(itemname);end; end;end.to liyinwei 似乎不行哦 你看看 是不是我哪里错了?ShowMessage出来的是整个页面的源文件数据。