|
-
May 11th, 2005, 03:48 AM
#1
Thread Starter
Lively Member
[RESOLVED]need to check weather or not a web element is present
heres the problem, I made a program the inputs to a website's text box. sometimes though, the box isnt on the page and I get an error message so I need to check weather or not the input box is there or not. or can I say:
VB Code:
webbrowser1.document.getElementbyName('"txtBox").item(0).some method?
if you know get back to me
Last edited by Aries Mars; May 11th, 2005 at 05:55 AM.
-
May 11th, 2005, 05:07 AM
#2
Frenzied Member
Re: need to check weather or not a web element is present
 Originally Posted by Aries Mars
heres the problem, I made a program the inputs to a website's text box. sometimes though, the box isnt on the page and I get an error message so I need to check weather or not the input box is there or not. or can I say:
VB Code:
webbrowser1.document.getElementbyName('"txtBox").item(0).some method?
if you know get back to me 
you can trap the error can't u?
-
May 11th, 2005, 05:44 AM
#3
Thread Starter
Lively Member
Re: need to check weather or not a web element is present
yes I could but then I found a method contained in :
this.document.body.contains(oElement) in the html DOM
here
but I cant seem to get it to work. They say in the site that the webbrowser control has access to the whole html DOM so this should work but it doesnt. I get a Type Mismatch error.
-
May 11th, 2005, 05:53 AM
#4
Thread Starter
Lively Member
Re: need to check weather or not a web element is present [RESOLVED]
While I was typing my reply to -Moinkhan- this syntax tried before hand, worked.
VB Code:
Dim contained As Boolean
contained =
wb.Document.body.contains(wb.Document.getElementsByName("txtInput").Item(0))
If contained Then wb.Document.getElementsByName("txtInput").Item(0).Value = text
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
|