x
Main Site login Signup

Search and click on href element

Hello, this is a code from web site:

 <div id="chooseChar">
     <ul>
         <li>
             <figure>
                 <img src="../gfx/avatar.png" alt="">
             </figure>
             <a class="link" href="game.php?a=mapa&amp;a2=char&amp;id=4496">Start</a>
         </li> 
     </ul>
 </div>

How can I search a href in div "chooseChar" by href value(game.php?a=mapa&a2=char&id=4496)?

I wrote a simple code to search for href element but it does not work:

         dynamic document = (JSObject)webControl1.ExecuteJavascriptWithResult("document");

         using (document)
         {
             var input = document.getElementsByTagName("a");

             if (input == null)
                 return;

             for (int i = 0; i < input.length; i++)
             {

                 if (input[i].getAttribute("href") == "game.php?a=mapa&a2=char&id=" + textBox3.Text)
                     MessageBox.Show("works");
             }
         }
asked Apr 21, 2016 at 10:46 AM avatar image Smashden 0
more ▼
(comments are locked)
10|1100 characters needed characters left

1 answer: sort voted first

bump

help me ;)

answered Apr 22, 2016 at 05:12 PM avatar image Smashden 0
more ▼
(comments are locked)
10|1100 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.