Click here to Skip to main content
14,668,652 members
Rate this:
Please Sign up or sign in to vote.
Im trying to automate some things for work, ive tried various methods so far, but its not working.

heres the html code , its within a frame, not complete but what i think pertains here.

http://imgur.com/3xUchoD[^]

I cant seem to get the webbrowser to do onclick, ive tried using the class method, and other ways.

<div id="main_account00" class="mainMenuLevel1" style="z-index: 1011; clip: rect(0px 130px 23px 0px); width: 130px; height: 23px; removed 1px; removed 1px; visibility: inherit;">Statement Status
<div id="main_account00_1" class="mainMenuLevel1over" style="removed 0px; removed 0px; visibility: hidden; clip: rect(0px 130px 23px 0px); width: 130px; height: 23px; z-index: 1012;">Statement Status
</div>
<div id="main_account00_3" class="clCMAbs" style="removed 0px; removed 0px; visibility: inherit; z-index: 1013;">
<a href="#" onmouseover="main.showsub('account00')" onmouseout="main.mout('account00')"  önclick="main.onclck('account00'); return false">
<img alt="" src="/pnet/prodtheme/prodimage/cm_fill.gif" width="130" height="23" border="0">
</a></div></div>


and here my current code that doesn't work.

Dim theElementCollection3 As HtmlElementCollection = Nothing
theElementCollection =WebBrowser1.Document.Window.Frames("ContentFrame").Document.GetElementsByTagName("div")
           For Each curElement3 As HtmlElement In theElementCollection
               If InStr(curElement3.GetAttribute("class").ToString, "clCMAbs") Then
                curElement3.InvokeMember("onclick")
            End If
next
Posted
Comments
CHill60 31-Dec-13 8:12am
   
Shouldn't "önclick" be "onclick" ?
Member 10494883 31-Dec-13 12:02pm
   
its onclick in the html code, somehow it got change when i submitted here.
CHill60 1-Jan-14 13:55pm
   
Well that knocks that theory out! :-) How about the "main.onclck" ... should that be "main.onclick"?
Member 10494883 1-Jan-14 18:18pm
   
nope, thats how it is in the code, it call a javascript function. i figured just doing click would call the function,

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100