1,593
社区成员
发帖
与我相关
我的任务
分享
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>标题</title>
<meta name="keywords" content=""/>
<meta name="description" content=""/>
这里嵌入了一些JS脚本
</head>
<script language="javascript">
//if (top.location != self.location)
</script>
<body>
中间省略
</body>
</html>
if (frmMain.wb1.ReadyState = 3) and
(not frmMain.wb1.Busy) then
begin
Html:=frmMain.wb1.OleObject.Document.documentElement.innerHtml;
{上面这句话只能获得head部分的、其他的源码都看不到、原因不明}
Html:=IHtmlDocument2(WebBrowser1.document).body.outerHTML;
{上面这句依然提示内存访问出错...}
end;
//timer里、就拿说的例子
var
html:string;
begin
if not f2.webbrowser.busy then
begin
html:=IHtmlDocument2(WebBrowser1.document).body.outerHTML;//就这里提示访问错误
end;
end;
uses MSHTML;
IHtmlDocument2(WebBrowser1.document).body.outerHTML