I've tried this so far:
Dim wreq As HttpWebRequest = WebRequest.Create("http://www.nasdaq.com/symbol/goog/financials?query=income-statement&data=quarterly") wreq.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5" wreq.Method = "get" Dim prox As IWebProxy = wreq.Proxy prox.Credentials = CredentialCache.DefaultCredentials Dim document As New HtmlAgilityPack.HtmlDocument Dim web As New HtmlAgilityPack.HtmlWeb web.UseCookies = True web.PreRequest = New HtmlAgilityPack.HtmlWeb.PreRequestHandler(AddressOf onPreReq) wreq.CookieContainer = cookies Dim res As HttpWebResponse = wreq.GetResponse() document.Load(res.GetResponseStream, True) Debug.WriteLine(document.DocumentNode.OuterHtml) But it returns the HTML for this web address: http://www.nasdaq.com/symbol/goog/financials?query=income-statement
Instead of this one: http://www.nasdaq.com/symbol/goog/financials?query=income-statement&data=quarterly
What am I doing wrong?
Additional Info
Here is onPreReq
Private Function onPreReq(req As HttpWebRequest) req.CookieContainer = cookies Return True End Function
dataargument isn't getting passed. Maybe try it like this - stackoverflow.com/a/17219511/1454048&data=quarterlypart, which seems to be ignored, right? That's just an extra argument that's part of a standard HTTPGETrequest. Try using the method in the link I put above, see if that helps.onPreReqthat is changing the address. I dont have the HtmlAgilityPack so I commented out some code and added in some other and it looked correct.