<html>
<head>
<META http-equiv=Content-Type content="text/html; charset=gbk">
<title>XXX公司生产运营监管系统</title>
</head>
<frameset rows=75,* cols="*" frameborder="no" bordercolor="#CCCCCC" name="aaa">
<frame src="top.jsp" noResize scrolling=no target="contents" name="banner">
<frameset id="bottommain" rows="*" cols=192,14,* bordercolor="#FFFFFF" framespacing="0" frameborder="no" border="0" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" >
<frame src="treemenu.html?method=listTreeMenu" target="main" name="contents" border="0" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
<frame src="middle.htm" name="mid" scrolling="NO" border="0" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
<frame src="测试1.html?method=list&first=1&timeType=50" name="main" border="0" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
</frameset>
<noframes>
<body>
<p>
此网页使用了框架,但您的浏览器不支持框架?
</p>
</body>
</noframes>
</frameset>
</html>
网页的代码如上。我想获取框架中的“测试1.html”网页的源代码里的一个“summonpwr169“元素 应该怎么实现。
name1=”summonpwr169“
Dim sws As New SHDocVw.ShellWindows
Dim ie As SHDocVw.InternetExplorer
For Each ie In sws
Dim doc1 As mshtml.HTMLDocument
doc1 = TryCast(ie.Document, mshtml.HTMLDocument)
If Not doc1 Is Nothing Then
If InStr(doc1.body.innerHTML, name1) <> 0 Then
doc1.body.all("" & name1 & "").value = doc1.body.all("" & name1 & "").value + rlt1
doc1.body.all("" & name2 & "").value = doc1.body.all("" & name2 & "").value + rlt2
doc1.body.all("" & name3 & "").value = doc1.body.all("" & name3 & "").value + rlt3
MsgBox("程序运行成功,请核对。", MsgBoxStyle.Information, "完成")
End If
End If
Next
我这段代码可以获取普通网页的代码,但是含有框架的就不行. 有个doc1.frames 但是我不会用.求指导。 谢谢了