50 pts.
 When calling on innertext values in Visual Basic 2008
To everyone, I have a problem. I am trying to automate a mouse click with in my browser. The first word in the inner text of the link stays constant but there is a number that follows the text that changes. Here is a sample of what i have. Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click For Each Link As HtmlElement In WebBrowser1.Document.Links If Link.InnerText = "fight a rock for $" Then Link.InvokeMember("Click") Exit Sub End If Next End Sub ...the button inner text is really displayed as, fight a rock for $2,000 but the dollar amount changes, however the alpha text and $ sign stay the same as shown above in the code. Is there a way to call on the inner text of a button with out giving all of its text and perform a click? Thank you, Missy

Software/Hardware used:
ASKED: November 29, 2008  12:36 AM
UPDATED: November 29, 2008  1:48 AM

Answer Wiki:
I'm not able to test it right now, but I think you could use the Substring method. Something like this: If Link.InnerText.<b>Substring</b>(1,18) = "fight a rock for $" Then Link.InvokeMember("Click")
Last Wiki Answer Submitted:  November 29, 2008  1:48 am  by  carlosdl   63,535 pts.
All Answer Wiki Contributors:  carlosdl   63,535 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _