Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
Hi
I think it would be best if i went in to more detail about what i have so far and what i want to achieve,
 
i work for an insurance company and sometimes we recieve an email from websites i.e Gocompare, Confused, CompareTheMarket saying we havent quoted for how ever many hours or minutes, then we open a web browser navigate to the relevant website and re-run a previous quote to clear the alarm, this is time consuming not by a great deal i know but i would like to just press one button and all of that happens so i can carry on with what im doing,
 
So far i have a windows form application with 4 buttons referencing different websites, and behind each button i want to be able to navigate to the relevant site and re-run previous quotes insted of manually going to the site and and entering the login details, and then clicking the "next" button to navigate through the pages until finally coming to the end to view quotes etc,
 
I dont want anything to pop up i just want a button to be pressed and thats it, the Webbrowser1 i have changed to the properties so it doesnt show,
 
if you need to have a better look in to this then please go to www.confused.com click home insurance, retrieve saved quotes, and on the screen you will see on the right the edit quote button, thats what im trying to press. the login details are scott.atkins@hotmail.co.uk password testtest
 
my code so far below navigates to the site and logs in, im then stuck on clicking the "EditQuote" image Frown | :-( im actually pulling my hair out at moment as i have searched and searched and i cant seem to find any examples Frown | :-( hopefully some one can help me with this...
 
Public Class Form1
 
  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    WebBrowser1.Navigate("https://www.confused.com/account/signin")
  End Sub
  Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
 
    Dim theelementcollection As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("Input")
    Dim count As Integer = 0
    For Each curelement As HtmlElement In theelementcollection
      If curelement.GetAttribute("Name").Equals("email") Then
        curelement.SetAttribute("Value", "itsupport@paragon-uk.net")
      ElseIf curelement.GetAttribute("Name").Equals("password") Then
        curelement.SetAttribute("Value", "PASSWORD")
      ElseIf curelement.GetAttribute("Value").Equals("") Then
        curelement.InvokeMember("click")
      End If
    Next
    count += 1
    If count = 1 Then
 THIS IS WHERE I NEED TO CLICK THE EDIT BUTTON
    End If
 
      Next
 
  End Sub
End Class
 
if someone can help me get passed this part i would really appreciate it, this is on a windows form application.
 
Hope to hear from someone soon.
 
Scott
Posted 28-Oct-10 2:52am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 28 Oct 2010
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100