procedure TForm1.Button1Click(Sender: TObject);
var
IDHTTP: TNMHttp;
temps,tempr:string;
i:integer;
function replacing(S,source,target:string):string;
var site,StrLen:integer;
begin
site:=pos(source,s);
if site<>0 then
begin
StrLen:=length(source);
delete(s,site,StrLen);
insert(target,s,site);
result:=replacing(s,source,target);
end
else
result:=s;
end;
begin
IDHTTP:= TnmHTTP.Create(nil);
try
try
IDHTTP.Get(EDIT1.Text);//取得网页内容
temps:=copy(idhttp.body,pos('#f6f6f6',idhttp.Body)-44,1065);
tempr:=replacing(replacing(replacing(temps,'<tr><td align='+#39+'center'+#39+' height='+#39+'18'+#39+' bgcolor='+#39+'#f6f6f6'+#39'>',''),'</td><td align='+#39+'center'+#39+' height='+#39+'18'+#39+' bgcolor='+#39+'#f6f6f6'+#39+'>',''),'</td></tr>','');
if ((length(tempr)-1) mod 16)=0 then
begin
for i:=1 to ((length(tempr)-1) div 16 )do
begin
memo1.Lines.Add(copy(tempr,1,11)+','+copy(tempr,12,5));
tempr:=copy(tempr,17,length(tempr));
end;
end;
except
end;
finally
IDHTTP.Free;
end;
end;
这个是我获取我中了网站的福彩开奖号码的代码,给你参考哦!呵呵!