View browser page source from another app?

  • Thread starter Thread starter Shishu Das
  • Start date Start date
S

Shishu Das

How can I get the page source from a browser window running on the same
box as my program?

shishudas
 
Shishu Das said:
How can I get the page source from a browser window running on the same
box as my program?

If you are using Internet Explorer:

\\\

' Requires a reference to "Microsoft Internet Controls" ("SHDocVw.dll").
On Error Resume Next
For Each IE As InternetExplorer In New ShellWindows
MsgBox(IE.Document.DocumentElement.innerHTML)
Next IE
On Error GoTo -1
///
 
Herfried,

Thanks! But, can you explain how to do this "reference" in VB.Net. I'm
new to this platform, and haven't fully RTFM.

Thanks!

shishudas

' Requires a reference to "Microsoft Internet Controls" ("SHDocVw.dll").
 
Shishu Das said:
Thanks! But, can you explain how to do this "reference" in VB.Net. I'm
new to this platform, and haven't fully RTFM.

"Project" -> "Add reference..." -> "COM" -> "Microsoft Internet Controls".
 
Got the reference OK, but it's still not liking this syntax. Just to
make this a little harder, I should mention that I would like to detect
(with a global hook) where the user clicked on the web page, so I can
tell what section of text they are looking at...

shishudas
 
Colin,

Thanks again!

I notice a reference to new features in .Net 2.0 that might make this
easier. Should I just upgrade to the new version and use those? Are you
familiar with them?

shishudas
 
shishudas,

Honestly, I have no experience with the 2.0 WebBrowser control other than
small test applications. If you want FULL control over the WebBrowser,
you're probably better off doing it yourself (starting with the wrapper),
but if you can live with the limited functionality that the 2.0 control
gives you, do it... it's MUCH easier.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top