|
-
Nov 10th, 2004, 06:18 AM
#1
Thread Starter
Junior Member
How to use HTMLDocument
Hi
I am trying to get the web page content using HTMLDocument in VB6, but I do not want to see the popup windows if the specified URL have any, How can I do that. Here is the code I am using
-------------- page1.html
<HTML>
<HEAD>
<TITLE>My First Page</TITLE>
<script language = "javascript">
function f()
{
window.open("page2.htm")
}
</script>
</HEAD>
<BODY onload = "f()">
<P>Hello</P>
</BODY>
</HTML>
-------------- page2.html
<HTML>
<HEAD>
<TITLE>My Child Page1</TITLE>
</HEAD>
<BODY>
<P>Hello , This is my test child page</P>
</BODY>
</HTML>
------------------------------------- vb form
Private Sub Command1_Click()
Dim objMSHTML As New MSHTML.HTMLDocument
Dim objDocument As MSHTML.HTMLDocument
Set objDocument = objMSHTML.createDocumentFromUrl("http://localhost/page1.html", vbNullString)
While objDocument.readyState <> "complete"
DoEvents
Wend
Text.Text = objDocument.documentElement.outerHTML
End Sub
after running this, I am getting the content of page1.html in the textbox, but a browser is opening with page2.html
If I send a request using MSXML2.XMLHTTP30 instead of HTMLDocument the the page2.html is not showing, but I have got a list of few URLs where MSXML2.XMLHTTP30 is not working, and the system is not responding at all. so I am thinking to go for HTMLObject
any suggestions
kajol
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|