我的应用正在点击错误的链接-请帮助我. [英] My app is making click on the wrong link - Please help me.
本文介绍了我的应用正在点击错误的链接-请帮助我.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
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.
推荐答案
最后尝试.ToList()
.这将为您提供List(Of HtmlElement)
.
然后,您可以从列表中选择所需的一个.例如,列表中的第二个对象将是list( 1 )
.
Try.ToList()
at the end. This will give you aList(Of HtmlElement)
.
You can then choose the one you want from the list. For example, the second object in the list would belist( 1 )
.
这篇关于我的应用正在点击错误的链接-请帮助我.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文