Results 1 to 4 of 4

Thread: Get data from web using proxy

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2010
    Posts
    3

    Get data from web using proxy

    Hy,
    I need to get data from IMDB using proxy. I made program which can download data, but the were downloaded on Croatian language because I'm from Croatia so I need to use UK proxy to get that data in English!

    Code:
    Dim url As String = "http://www.imdb.com/search/title?sort=moviemeter,asc&start=" & j & "&title_type=feature&year=2010,2010"
                Dim html, naslov, ocjena As String
                Dim request As Net.HttpWebRequest = Net.HttpWebRequest.Create(url)
                Dim response As Net.HttpWebResponse
                response = request.GetResponse
                Using sr As New IO.StreamReader(response.GetResponseStream)
                    html = sr.ReadToEnd()
                End Using
                request.Abort()
                response.Close()
    How to use proxy in this code? I really need help with this...

    Thanks in advance, dapapo

  2. #2
    Hyperactive Member
    Join Date
    Nov 2008
    Location
    USA
    Posts
    257

    Re: Get data from web using proxy

    do you have a proxy list

    if so try this

    Code:
    Dim IP As String = String.Empty
                Dim index As New Random
                Dim num As Integer = 0
                proxylist = New ArrayList
    
    Dim url As String = "http://www.imdb.com/search/title?sort=moviemeter,asc&start=" & j & "&title_type=feature&year=2010,2010"
                Dim html, naslov, ocjena As String
                Dim request As Net.HttpWebRequest = Net.HttpWebRequest.Create(url)
    
    
     Dim oldproxy As IWebProxy = CType(request.Proxy, IWebProxy)
                        num = index.Next(0, proxylist.Count)
                        IP = proxylist.Item(num)
                        Dim Port As String = "80"
                        Dim proxy As New WebProxy() '& ":" & Port, True
                        Dim newuri As New Uri("http://" & IP)
                        proxy.Address = newuri
                        request.Proxy = proxy
    -- Please rate me if I am helpful --

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2010
    Posts
    3

    Re: Get data from web using proxy

    Where to add proxy list?

    And how to make if I only wnat to use one proxy?

    p.s. in which format proxy must be in the list?
    Last edited by dapapo; Nov 30th, 2010 at 07:23 AM.

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2010
    Posts
    3

    Re: Get data from web using proxy

    bump

Posting Permissions

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



Click Here to Expand Forum to Full Width