|
-
Nov 29th, 2010, 10:47 AM
#1
Thread Starter
New Member
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
-
Nov 29th, 2010, 11:51 AM
#2
Hyperactive Member
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 --
-
Nov 30th, 2010, 01:39 AM
#3
Thread Starter
New Member
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.
-
Dec 5th, 2010, 12:25 PM
#4
Thread Starter
New Member
Re: Get data from web using proxy
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|