Auto Login to Website to Retrieve Useful Information

wonder_gal

Active member
Joined
Jun 5, 2006
Messages
34
Programming Experience
1-3
Hi,


I need to write a windows application to automatically login to a website(with username and password being provided) to retrieve some data from the website. Can someone show me an example on how to accomplish this in VB.NET? Thanks alot.
 
I made how to log-in automatically on page, but how i can extract from html source (tags) i dunno ;P

Dim bDone As Boolean = False
sub navigate()
browser.Navigate("yoururl")
end sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) _
Handles browser.DocumentCompleted
If browser.ReadyState = WebBrowserReadyState.Complete And bDone = False Then
bDone = True
DoOnceAfterDocComplete()
End If
End Sub

Sub DoOnceAfterDocComplete()

browser.Document.GetElementById("username").InnerText = username.Text
browser.Document.GetElementById("password").InnerText = password.Text
browser.Document.GetElementById("login").InvokeMember("click")
endsub
 
Back
Top