I had some code that worked about a year ago to scrape a website bit have not used it recently…
The code to get the HTML is simply:
HTML = DefineEncoding(Get(theURL, kTimeOut).Trim, Encodings.UTF8)
It used to work… But now I get a redirect…
So I changed the code to:
HTML = DefineEncoding(me.Get(theURL, kTimeOut).Trim, Encodings.UTF8)
Select Case me.HTTPStatusCode
Case 301, 302
theURL = me.PageHeaders.CommaSeparatedValues("Location")
HTML = DefineEncoding(Get(theURL, kTimeOut).Trim, Encodings.UTF8)
End Select
But the redirected URL is the same as the original one and I get getting a redirect!!! This is the URL I have been testing with:
Yet when I paste that exact URL in a browser, the page shows correctly and the address bar still shows the original URL … I have no idea what the problem is … any ideas how to get this to work again?