Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2011-09-25
4
Medium Priority
?
455 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

722 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