Smith
Smith

Reputation: 5951

How to click link in webbrowser

i am trying to click a div a link in the webrowser in vb6 without success, the structure of the link is like this

<a class="classname">
    <div class="classname2"></div>
    <span class="span">spantext</span>
</a>

Upvotes: 1

Views: 5814

Answers (1)

wqw
wqw

Reputation: 11991

You can navigate DOM from outside like this

WebBrowser1.Application.Document.all("id_or_name").Click

or you can execute JScript to do whatever you want from inside like this

WebBrowser1.Application.Document.parentWindow.execScript "id_or_name.click();"

Upvotes: 2

Related Questions