读书人

急关于webbrowsers的有关问题

发布时间: 2012-02-04 15:43:08 作者: rapoo

急急急,关于webbrowsers的问题
代码如下:
i:=webbrowser1.oleobject.document.documentelement.document.frames.length;
memo1.Lines.Add('have Frames: '+inttostr(i));
for j:=0 to i-1 do
begin
memo1.lines.add('');
memo1.Lines.Add('Frame '+inttostr(j+1)+' from here');
memo1.Lines.Add(webbrowser1.oleobject.document.documentelement.document.frames.item(j).document.documentelement.innerhtml);
End;

运行的时候得到frame有两个.

memo1.lines.add(webbrowser1.oleobject.document.documentelement.document.frames.item(0).document.documentelement.innerhtml);

时候,程序运行出现下面错误"Project Project1.exe raised exception class EOleException with message'拒绝访问'.Process
stopped.Use Step or Run to continue"

请大大们帮忙看看

[解决办法]
你那个代码太乱了。。。复制粘贴的时候没弄好吧。
[解决办法]

[解决办法]
此波不好抓,请我抓彼波再告知你怎么抓
[解决办法]
memo1.lines.add(webbrowser1.oleobject.document.documentelement.document.frames.item(0).document.body.innerhtml);

这里改一下试试document.body.innerhtml);

读书人网 >.NET

热点推荐