上面的问题搞定了。还有还有一点就是,如果我要提取下面的内容<tr> <td align="center">天气</td><td><img src="/image/b1.gif" alt="多云" /><img src="/image/b7.gif" alt="小雨" />
多云转小雨</td><td><img src="/image/b3.gif" alt="阵雨" />
阵雨</td><td><img src="/image/b7.gif" alt="小雨" /><img src="/image/b3.gif" alt="阵雨" />
小雨转阵雨</td><td><img src="/image/b7.gif" alt="小雨" /><img src="/image/b1.gif" alt="多云" />
小雨转多云</td><td><img src="/image/b7.gif" alt="小雨" /><img src="/image/b1.gif" alt="多云" />
小雨转多云</td><td><img src="/image/b1.gif" alt="多云" />
多云</td><td><img src="/image/b1.gif" alt="多云" />
多云</td> </tr> <tr>就只要提取第一行的话,我的代码如下,但问题来了,如果是2个字节,如“多云”,5个字节,“小雨转多云”。就会把后面的</TD>也显示出来。procedure TForm1.Button2Click(Sender: TObject);var rStream: TStringStream;begin rStream:= TStringStream.Create('', TEncoding.Default); IdHTTP1.Get('http://qq.ip138.com/weather/qinghai/gonghe.htm',rStream); statusbar1.Panels[1].Text :=rStream.DataString; p:=pos('/>
',StatusBar1.Panels[1].Text)+Length('</td>'); if p>=4 then begin statusbar1.Panels[1].Text :=copy(statusbar1.Panels[1].Text,p+2,4); end; if p>=5 then begin statusbar1.Panels[1].Text :=copy(statusbar1.Panels[1].Text,p+2,8); end;end;这么打代码好像不行啊。有谁会解决吗?