Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
C# Community
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
VB.NET
VB.NET General Discussion
Having hard time to CLICK a couple of links in a Webbrowser control!
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Greek, post: 167708, member: 50282"] I made this vb.net application that among other things automates a site inside some webbrowser controls. So I already managed to press lots of links, buttons, dialogs etc. There is a particular page though that gives me trouble to press its links. Here is a part of its code where the 2 links are shown [HTML] <img id="submissionShow:submissionTable:0:j_idt67" alt="" src="/SITE/faces/javax.faces.resource/spacer/dot_clear.gif?ln=primefaces" width="5px"> <a id="submissionShow:submissionTable:0:j_idt69" href="#" class="ui-commandlink" onclick="PrimeFaces.ab({formId:'submissionShow',source:'submissionShow:submissionTable:0:j_idt69',process:'@all',update:'submissionShow:errorDlgMsg',oncomplete:function(xhr, status, args){handleOpenRequest2(xhr, status, args);}});return false;">SECONDLINKTOCLICK</a><img id="submissionShow:submissionTable:0:j_idt70" alt="" src="/SITE/faces/javax.faces.resource/spacer/dot_clear.gif?ln=primefaces" width="5px"> <a id="submissionShow:submissionTable:0:j_idt72" href="#" class="ui-commandlink" onclick="PrimeFaces.ab({formId:'submissionShow',source:'submissionShow:submissionTable:0:j_idt72',process:'@all',update:'submissionShow:errorDlgMsg',oncomplete:function(xhr, status, args){handleOpenRequest2(xhr, status, args);}});return false;">SOMEOTHERLINK</a><img id="submissionShow:submissionTable:0:j_idt73" alt="" src="/SITE/faces/javax.faces.resource/spacer/dot_clear.gif?ln=primefaces" width="5px"> <img id="submissionShow:submissionTable:0:j_idt76" alt="" src="/SITE/faces/javax.faces.resource/spacer/dot_clear.gif?ln=primefaces" width="5px">[/HTML] I want to click the submissionShow:submissionTable:0:j_idt67 link and in another instance (later on the program, not after the previous link) the submissionShow:submissionTable:0:j_idt69. [I](I may also have problem identify the links, because the last part after the submissionShow:submissionTable:0: changes, but lets leave that one for later)[/I] I did many attempts but in vain. Here's my last one: [CODE] [COLOR=blue]Dim[/COLOR] Check2 [COLOR=blue]As[/COLOR] [COLOR=#2b91af]HtmlElement[/COLOR] = [COLOR=blue]Me[/COLOR].WebBrowser1.Document.GetElementById([COLOR=#a31515]"submissionShow:submissionTable:0:j_idt67"[/COLOR]) ' Just wait for the element to appear [COLOR=blue]Dim[/COLOR] id1 [COLOR=blue]As[/COLOR] [COLOR=blue]String[/COLOR] = [COLOR=#a31515]"submissionShow:submissionTable:0:j_idt67"[/COLOR] [COLOR=blue]While[/COLOR] IsNothing([COLOR=blue]Me[/COLOR].WebBrowser1.Document.GetElementById(id1).InnerHtml.ToString) [COLOR=#2b91af]Application[/COLOR].DoEvents() Threading.[COLOR=#2b91af]Thread[/COLOR].Sleep(100) [COLOR=blue]End[/COLOR] [COLOR=blue]While[/COLOR] ' Click the element Check2.InvokeMember([COLOR=#a31515]"click"[/COLOR]) [/CODE] Similar code works in other parts of my program but not this one. Same for the (different kind, 67 is a transparent image?) 2nd link [COLOR=#a31515]j_idt69[/COLOR] Any thoughts? [/QUOTE]
Insert quotes…
Verification
Post reply
VB.NET
VB.NET General Discussion
Having hard time to CLICK a couple of links in a Webbrowser control!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top
Bottom