Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2010 > Visual Basic 2010 General Discussion
|
Visual Basic 2010 General Discussion For any discussions about Visual Basic 2010 topics which aren't related to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2010 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 25th, 2012, 08:15 PM
Registered User
 
Join Date: Nov 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Visual basic activate a button on a web page

Hello. New to this forum and fairly new to Visual Basic.
I am writing some VB code to automatically load and log on to a web page.
Using the web browser navigate function the following code will load the web page https://www.tomwaterhouse.com/ then enter my user name , then password and then click(submit) the login button.
My problem is that once logged on to the web page I do know how to activate the “Greyhounds” button to take me to the next page.
Any Help would be appreciated.

************************************************** ****

Public Class Form1
Dim flagg As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
WebBrowser1.Navigate("https://www.tomwaterhouse.com/")
flagg = "login"
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

******* need to put code here to click Greyhounds button

End Sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEv entArgs) Handles WebBrowser1.DocumentCompleted
If flagg = "login" Then
WebBrowser1.Document.GetElementById("UserID").SetA ttribute("Value", "UserName")
WebBrowser1.Document.GetElementById("Password").Se tAttribute("Value", "Password")
WebBrowser1.Document.GetElementById("LogonForm").I nvokeMember("submit")
End If
flagg = ""
End Sub





Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic 2010 - Click a button on a website jd29 .NET 4 and Visual Studio 2010 General Discussions 7 September 28th, 2012 03:27 PM
page 154 Begining Visual Basic 2005 fergi BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 2 July 24th, 2006 04:54 PM
FTP in Visual Studio 2005 Pro (Visual Basic) shoopes VB How-To 1 June 29th, 2006 02:08 PM
Login to web portal from visual basic form Raghavendra_Mudugal VB How-To 0 December 2nd, 2004 03:10 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.