procedure TForm1.Button14Click(Sender: TObject);
var
machs: IMatchCollection;
Matchs: Match;
submatch: ISubMatches;
i: integer;
url,url1:string;
begin
url:='http://www.cnblogs.com/del/archive/2007/12/21/1009482.html';
str :=idhttp1.get(url);
RegExp1.Global := true;
RegExp1.Pattern :='<img src=\"(.+?)\"';
RegExp1.IgnoreCase := true;
machs := RegExp1.Execute(str) as IMatchCollection;
for i := 0 to machs.Count - 1 do
begin
Matchs := machs.Item[i] as Match;
submatch := Matchs.SubMatches as ISubMatches;
memo4.Lines.Add(matchs.Value);
end;
end;
URL随便写个网址就能匹配到源代码中的图片地址,但是写本地的HTML文件(file:///D:/6.21/6.21/index.htm)就是不行,提示错误 EIDUnknownProtocol with message '' 是不是地址的问题呀 但那个// 能组合的我几乎换遍了 就是不行 求教啊
var
machs: IMatchCollection;
Matchs: Match;
submatch: ISubMatches;
i: integer;
url,url1:string;
begin
url:='http://www.cnblogs.com/del/archive/2007/12/21/1009482.html';
str :=idhttp1.get(url);
RegExp1.Global := true;
RegExp1.Pattern :='<img src=\"(.+?)\"';
RegExp1.IgnoreCase := true;
machs := RegExp1.Execute(str) as IMatchCollection;
for i := 0 to machs.Count - 1 do
begin
Matchs := machs.Item[i] as Match;
submatch := Matchs.SubMatches as ISubMatches;
memo4.Lines.Add(matchs.Value);
end;
end;
URL随便写个网址就能匹配到源代码中的图片地址,但是写本地的HTML文件(file:///D:/6.21/6.21/index.htm)就是不行,提示错误 EIDUnknownProtocol with message '' 是不是地址的问题呀 但那个// 能组合的我几乎换遍了 就是不行 求教啊
解决方案 »
- 请问如何改变listbox的item的颜色?
- 如何实现当鼠标点击edit时,执行edit的OnKeyPress事件?
- 16进制的byte存放
- 急~!如何动态设定TChart/TDbChart中Series的数据集?
- 现在做一个程序,要将原有手工填写的表格做成电子版的,并且在输入的地方嵌入EDIT或COMBOX?用什么方法实现啊?急急急!!
- 在线等待 请教TDeviceMode类型。
- 高高手的问题:如何关闭窗体
- 利用saveDialog保存文件时,怎样为文件添加后缀呢?
- 急急急 !!!!怎么在delphi中用UPDATE 语句将表里的某个字段的值更新为空呢?
- DELPHI如何换行,5分钟100分,来者有分!!!
- 用delphi 编写的串口调试精灵
- INI文件内容能不能HINT显示出来
file这是啥协议呢?
本地的话自己架设一个HTTP通过
idhttp1.get('http://127.0.0.1/index.htm');
这样就可以了