|
-
Jan 11th, 2003, 05:49 PM
#1
Thread Starter
Lively Member
press button on webbrowser
Q1)
what i want to do is press a button, this is the code i tried:
WebBrowser1.Document.Forms(0).SEARCH.Submit = True
all i know is that the value of the button is 'SEARCH', i got the 'WebBrowser1.Document.Forms(0).' part from searching for
the solution. i think there is a problem with the '.Submit = True' part, this was simply a guess, what is the correct code?
Q2)
how do you have a string for a part of the code, e.g.
myvalue = value.text
WebBrowser1.Document.Forms(0). & myvalue & .value = "whatever"
why doesnt that work?
Q3)
is there an easy way to find values of text boxes/buttons on a website without copying the html?
thanks for all help.
-
Jan 11th, 2003, 10:35 PM
#2
The picture isn't missing
i think it is
WebBrowser1.Document.Forms(0).SEARCH.Click
or if the style of the button IS submit, then
WebBrowser1.Document.Forms(0).submit
#2, try this:
myvalue = value.text
WebBrowser1.Document.Forms(myvalue).value = "whatever"
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Jan 11th, 2003, 11:13 PM
#3
FYI.. the forms(0) can be other numbers...if the webpage has multiple forms..you may have to change the number to 1,2,3...etc till you hit it..
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Jan 12th, 2003, 10:16 AM
#4
Thread Starter
Lively Member
WebBrowser1.Document.Forms(0).submit worked for pressing the button, thankyou.
however your solution for question 2 didnt as this just changes what form, not the object on the form. any other suggestions?
thanks.
-
Jan 12th, 2003, 01:01 PM
#5
I am not fully understanding your question...(#2)
but if im looking at it right...you want to replace part of the code with a string value right?
let me try something...
yes you can... what you seem to want to do is set a varible from a textbox? on your form or the webpage form??
anyway..
VB Code:
myvalue = value.text
Webbrowser1.Document.Forms(0).Item(myvalue).value = "Whatever"
that should do it
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
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
|