[Resolved]Using webbrowser with Sendkey
i am using the Webbroswer control to open mail.yahoo.com , but when i tried to sendkeys to mail.yahoo.com , nothing happens , the cursor wasn't in the textbox .
but however when i use shell to use internet explorer to open mail.yahoo.com(note a new internet explorer windows will be open) , i am able to send keys to login for me ?
So any one had any idea between Shell and Webbrowser control ?
Re: Using webbrowser with Sendkey
Don't use SendKeys when filling in data in the WebBrowser control; it's unreliable. Check out the articles in my signature, especially the second one. :)
Re: Using webbrowser with Sendkey
Quote:
Originally Posted by TheVader
Don't use SendKeys when filling in data in the WebBrowser control; it's unreliable. Check out the articles in my signature, especially the second one. :)
hmm.. thnxs for the replies but after going through the 2nd articles in your signature , i notice that the 2nd article talk about creating a browser but did not say anything on filling values to a webpage like mail.yahoo.com or something similar like sendkeys .
Re: Using webbrowser with Sendkey
I don't know exactly what you want to fill in, but in the second article I advocated the use of the Document Object Model to manipulate pages. If, for example, you want to insert text in the first textbox on the page, you can use this code: :)
VB Code:
WebBrowser1.Document.getElementsByTagName("input").item(0).value = "text"
Re: Using webbrowser with Sendkey
Quote:
Originally Posted by TheVader
I don't know exactly what you want to fill in, but in the second article I advocated the use of the Document Object Model to manipulate pages. If, for example, you want to insert text in the first textbox on the page, you can use this code: :)
VB Code:
WebBrowser1.Document.getElementsByTagName("input").item(0).value = "text"
Thanks , i guess i nid to read through ur article more clearly to understand it , but one last question how do u know of all the methods and attributes that is in the document ? cos i realise mine vb 6 does not show have any drop down when i enter the webbrowser1.document. so i thought the code doesn't work at 1st ? anyway thumbs up for the help :thumb: :wave:
Re: [Resolved]Using webbrowser with Sendkey
In this section of MSDN you can find all methods and properties that you can use. :)
Re: [Resolved]Using webbrowser with Sendkey
seems to be abit like html but 1 last question is that is it possible to use it to "fire/press enter" on a specific command button .
Re: [Resolved]Using webbrowser with Sendkey
It is HTML... ;) At least, it's a way to crawl through an HTML page.
You can use the Click method on a command button to programmatically click it.
VB Code:
WebBrowser1.Document.getElementsByTagName("button").item(0).Click
Re: [Resolved]Using webbrowser with Sendkey