Solved

vb.net how to click in a table by webbrowser vb 2008 express

Posted on 2011-09-25
4
412 Views
Last Modified: 2012-05-12
helo friends, i am need click in a link in a tabe in vb.net
normal buttons i am use
WebBrowser1.Document.GetElementById("mario").InvokeMember("click")
this html is
<table id="tbMenuVertical" class="tbMenuVertical" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top">
<div id="divContainerMenu" class="divContainerMenu">
<table id="tbRetraltilPai1" class="tbItemPaiSlc" onmouseout="mudaClassePai('1',2)" onmouseover="mudaClassePai('1',1)">
<tbody>
<tr>
<td class="tdTituloMenuPai" colspan="2">
<a class="aMenuNomeSel" href="#" onclick="mudaClasseLink(this,1,0,0);CloseAll();ajaxProcessUrl('/aapj/marios/sndnnd.ba', tratarResposta);return false;">Marcação online</a>
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
please help me for click in this. thanks
0
Comment
Question by:kidd12
  • 2
  • 2
4 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 36599507
The HTMLTable element does have the "click" event, so did you try to use the same code?  Does the table have an ID?
0
 

Author Comment

by:kidd12
ID: 36601959
no have id, i am trying this
Dim doc As Object
        Dim element As Object
        Dim elemento As Object
        Dim i As Integer
        doc = webBrowser1.Document as HtmlDocument
        element = doc.links
        For i = 0 To element.count - 2

            elemento = element.item(i)
            If InStr(Endereco.Text, elemento.outerText) > 0 Then
                elemento.InvokeMember("click")
            End If
        Next
and got error end of statement expected
please help me for use this code. thanks
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 36601993
What line do you get the exception on? My guess is that you copied from C# code.

Correction:
doc = TryCast(webBrowser1.Document, HtmlDocument)

Open in new window


You don't need to cast the document to HtmlDocument, since that is what the type is already.

You can use GetElementsByTagName to limit the search to just the <table> elements.
0
 

Author Closing Comment

by:kidd12
ID: 36602085
thanks
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now