Results 1 to 2 of 2

Thread: WebBrowser using alternating proxies

  1. #1
    Hyperactive Member simpleonline1234's Avatar
    Join Date
    Mar 10
    Posts
    320

    WebBrowser using alternating proxies

    My application uses the webbrowser component and currently is setup to handle proxies. I can't seem to figure out how to alternate my proxies in my webbrowser.

    For instance I have a list of about 100 proxy by IP:PORT and I can enter each one at a time but not to sure on how to alternate them. I was thinking to setup a counter on my webBrowser completed in my for each statement that I use to grab an html element.

    This part I can do but how can I set my code to grab the next proxy after say 20 passes?

    Thanks

    Code:
        For Each element As HtmlElement In WebBrowser1.Document.GetElementsByTagName("a")
                RichTextBox1.Text = RichTextBox1.Text & element.GetAttribute("href") & vbNewLine
            Next
    Thinking maybe use a counter?

    Code:
    Public Class tester
    Dim counter as integer = 0
    _________________________________________________________
    Code:
      Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
            WebBrowser1.Navigate("http://www.mytestsite.com")
             counter = 1
       
        End Sub
    If counter = 20 then proxytext.text = ???
    For Each element As HtmlElement In WebBrowser1.Document.GetElementsByTagName("a")
    RichTextBox1.Text = RichTextBox1.Text & element.GetAttribute("href") & vbNewLine
    counter = counter + 1
    Next
    [/CODE]
    Are you down with OOP?

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 12
    Posts
    5,501

    Re: WebBrowser using alternating proxies

    It's saying timer to me. Declare a global variable for an index. On the tick increment the index, select the next one on the list with it and load.
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •