vb.net - Visual Basic: Clicking a button on a webpage -
i trying make program click login button of twitch.tv. have tried many methods thing can not find button id of button. assume doesn't have 1 , need clicking it. commands used click button if has no id? here html of button
<div class="buttons"> <button class="primary_button" tabindex="10" type="submit"><span class="">log in</span> so see have no id on button says log in. i'm asking is, coding command clicking buttons without id. buttons 1 no id, class , type.
the following code far typing in log in info not hitting submit button
private sub button5_click(byval sender system.object, byval e system.eventargs) handles button5.click dim allelements htmlelementcollection = webbrowser1.document.all webbrowser1.document.getelementbyid("login_user_login").setattribute("value", "123@gmail.com") webbrowser1.document.getelementbyid("user[password]").setattribute("value", "123@gmail.com") 'type = "submit" if webpageelement.getattribute("type") = "log in" webpageelement.invokemember("click") end if end sub
iedoc = mybrowser.document iedoc.forms(0) .username.value = loguser .password.value = logpasswrd .submit end
Comments
Post a Comment