Click here to Skip to main content
15,887,854 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
Ok I am using this code :

[CODE]Dim element As HtmlElement = wbForumpm.Document.GetElementsByTagName("a").Cast(Of HtmlElement).Where(Function(el) el.GetAttribute("rel") = "nofollow").Last
        If element IsNot Nothing Then element.InvokeMember("click")[/CODE]


In the same page there are several link with sames elements for example:

[COLOR="Red"]1-<a accesskey="2" href="http://www.cristovideos.com/search.php?do=getnew" rel="nofollow">New Page</a>[/COLOR]

2-<a rel="nofollow" href="http://www.cristovideos.com/musica.php?do=newmusic&u=60758">publicar cancion</a>


[COLOR="Red"]3-<a href="http://www.adoretube.com" rel="nofollow">adoretube</a>[/COLOR]

Now if I use at the end .Firstordefault the app make click on number one . and If I use .last  the app make click on number 3 .

I need to make click in the number 2. Please help me.
Posted

1 solution

Try .ToList() at the end. This will give you a List(Of HtmlElement).

You can then choose the one you want from the list. For example, the second object in the list would be list( 1 ).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900