Hooking up InternetExplorer to a WebBrowser control

  • Thread starter Ludwig Wittgenstein
  • Start date
L

Ludwig Wittgenstein

Hi, all.

How can i hook up an InternetExplorer object to a WebBrowser
control that I have in my windows form. Basically what I want to do is
automate the WebBrowser control via the InternetExplorer object
(instead of loading iexplorer.exe externally...).


Thanks,
 
V

VJ

WebBroswer Control is the IE control... you don't need the IE object, what
is your exact intent.
 
L

Ludwig Wittgenstein

I want to have an embedded browser in my winform app that I can run
automated tasks against. For example, I want to load a web page
through the embedded browser and be able to located html tags (by ID
or name) and be able to click them (programmatically). Can you do that
using the WebBrowser control?
I know you can using SHDocVw.InternetExplorer.

Thanks,
 
L

Ludwig Wittgenstein

I want to have an embedded browser in my winform app that I can run
automated tasks against. For example, I want to load a web page
through the embedded browser and be able to located html tags (by ID
or name) and be able to click them (programmatically). Can you do that
using the WebBrowser control?
I know you can using SHDocVw.InternetExplorer.

Thanks,
 
J

Jon Davis

The WebBrowser control is already a wrapper of SHDocVw.InternetExplorer. To
access SHDocVw.InternetExplorer, look at the "WebBrowser.ActiveXControl"
property.

Jon
 
J

Jon Davis

Ludwig Wittgenstein said:
I want to have an embedded browser in my winform app that I can run
automated tasks against. For example, I want to load a web page
through the embedded browser and be able to located html tags (by ID
or name) and be able to click them (programmatically). Can you do that
using the WebBrowser control?

Yes, look at WebBrowser.Document.

Jon
 
L

Ludwig Wittgenstein

Hi, Jon.

Thanks for your reply, I was unable to find any automation methods
for WebBrowser, all I found was grabbing information from the
browser's current document (html), but nothing about automating
clicking something in the document to go to another. Can you please
point me to the actual class methods that can do this.


Thanks a lot!
 
J

Jon Davis

For said automation, you can either introspect the href attribute of an <a>
tag and use the Navigate() method, or in the case of forms you can execute
the submit() method on the form object by calling the InvokeMember("submit")
method on the DOM element.

Jon
 

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

Top