-
Jun 22nd, 2017, 12:38 AM
#1
Thread Starter
Junior Member
Help html element Click on a single push button
Hello
I have written many codes so that the program clicks on the buttons inside a page in the Webbrowser so that these buttons do not contain information or elements like me
<Button>
Test
</ Button> is only text
But I am now the problem that the program is clicking on the first button and I want to click all the buttons containing the text Test at once
The codes you typed but clicked on the first button only:
*Code:
PHP Code:
For Each Buttonc1 As HtmlElement In WebBrowser1.Document.GetElementsByTagName ("Button") ****************If Buttonc1.InnerText = TextBox1.Text Then ********************Buttonc1.InvokeMember ("Click") ****************End If
And
*Code:
PHP Code:
*For Each ss As HtmlElement In WebBrowser1.Document.GetElementsByTagName ("Button") ****************If ss.InnerText = "Test" Then ********************Ss.InvokeMember ("click") ******************* *************End if
This is a page I create http://arabi.yoo7.com/h9-page 'You must take into account the values on the page and placed in the above code
I want the program to click all the buttons on the page at once by the above code
Last edited by si_the_geek; Jun 22nd, 2017 at 08:57 AM.
Reason: removed extra-large formatting
-
Jun 22nd, 2017, 09:00 AM
#2
Re: Help html element Click on a single push button
Right now your code iterates through each DOM element who's tag name is <button>, but inside the iteration you're checking if the InnerText value equals either a TextBox's text or the String literal "Test". If you want to click every DOM element who's tag name is <button>, then simply omit the conditional statement in the For/Each loop.
-
Jun 22nd, 2017, 07:17 PM
#3
Thread Starter
Junior Member
Re: Help html element Click on a single push button
Actually it's a nice idea but the page contains many buttons and I want to click on the buttons containing the text <test > only
my beloved brother
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
|