So i basically need a code to get a website source.
It has to use cookies (because otherwise that website will return an error) and be able to use proxy.
I tried this code :
This code works fine on most of the websites i tried it. But not on the website i need right now.
That website is : http://pastebin.com/mQqLKtes
It has to use cookies (because otherwise that website will return an error) and be able to use proxy.
I tried this code :
Code
Private Function page_source(ByVal URL As String, proxy As String) As String
Try
Dim reader As StreamReader
Dim Request As HttpWebRequest = HttpWebRequest.Create(URL)
Request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14"
Request.CookieContainer = CC
If proxy.Length > 4 Then
Dim myProxy As New WebProxy(proxy)
Request.Proxy = myProxy
End If
Dim Response As HttpWebResponse = Request.GetResponse()
reader = New StreamReader(Response.GetResponseStream())
Return reader.ReadToEnd()
Response.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End FunctionThis code works fine on most of the websites i tried it. But not on the website i need right now.
That website is : http://pastebin.com/mQqLKtes



![[Image: GUsQZTN.gif]](https://i.imgur.com/GUsQZTN.gif)
![[Image: f248deabc6dcfbafa75eec39f3e6aae6.png]](https://i.gyazo.com/f248deabc6dcfbafa75eec39f3e6aae6.png)
![[Image: 3687544d3047015294daf2bda45d1388.png]](https://i.gyazo.com/3687544d3047015294daf2bda45d1388.png)