-
Sep 20th, 2020, 10:10 PM
#1
Thread Starter
Hyperactive Member
WebClient.DownloadString(URL) returns Error 403 - Forbidden
From the browser, the page is accessible without any problems, but from my VB.NET code, I get an error.
When I try to download the HTML of this page :
https://www.gamestop.com/toys-collec.../11097180.html
I get an Error - 403
In my application I download a lot of other URL from other websites and I never had that problem before. I guess GameStop website has something different that could cause the problem.
Anyone has an idea on how to solve my issue? I tried many solution, including adding headers like agent-user, etc but nothing worked.
Thanks for any tips or help you can give me.
-
Sep 21st, 2020, 08:19 AM
#2
Re: WebClient.DownloadString(URL) returns Error 403 - Forbidden
-
Sep 21st, 2020, 08:49 AM
#3
Re: WebClient.DownloadString(URL) returns Error 403 - Forbidden
The provided link returns 403 in the browser. Also the main site (gamestop.com/) returns 403. Tested with two 3 ISPs from 2 different countries.
-
Sep 21st, 2020, 08:53 AM
#4
Thread Starter
Hyperactive Member
Re: WebClient.DownloadString(URL) returns Error 403 - Forbidden
Could not be simpler.
Code:
Try
Dim strHTML As String = String.Empty
System.Net.ServicePointManager.SecurityProtocol = Net.SecurityProtocolType.Tls12
Dim wcWebClient As New System.Net.WebClient
'wcWebClient.Headers.Add("User-Agent: Mozilla/ 5.0(Windows NT 10.0; Win64; x64; rv: 79.0) Gecko/20100101 Firefox/79.0")
'wcWebClient.Headers.Add("Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8")
'wcWebClient.Headers.Add("Accept-Language: en-US,en;q=0.5")
'wcWebClient.Headers.Add("Accept-Encoding: gzip, deflate, br")
strHTML = wcWebClient.DownloadString("myURLHere")
' I have other code here ... but the "DownloadString" above is the line that triggers the exception.
Catch ex As Exception
Return False
End Try
-
Sep 21st, 2020, 08:55 AM
#5
Thread Starter
Hyperactive Member
Re: WebClient.DownloadString(URL) returns Error 403 - Forbidden
Originally Posted by peterst
The provided link returns 403 in the browser. Also the main site (gamestop.com/) returns 403. Tested with two 3 ISPs from 2 different countries.
What do you mean "link returns 403 in the browser" ? How do you test that? I access the page in 3 different browsers (IE, FF, Chome) without any problems.
-
Sep 21st, 2020, 08:56 AM
#6
Re: WebClient.DownloadString(URL) returns Error 403 - Forbidden
Multi-country checks - seems forbidden in many places:
-
Sep 21st, 2020, 09:05 AM
#7
Re: WebClient.DownloadString(URL) returns Error 403 - Forbidden
I'm in Australia and if I click the link in post #1 the page displays fine for me in Edge.
-
Sep 21st, 2020, 09:06 AM
#8
Thread Starter
Hyperactive Member
Re: WebClient.DownloadString(URL) returns Error 403 - Forbidden
Originally Posted by peterst
Multi-country checks - seems forbidden in many places:
Render Unavailable from California is weird. GameStop is in USA.
Where are you located? I am in Canada and from here it works in all browser.
-
Sep 21st, 2020, 09:44 AM
#9
Re: WebClient.DownloadString(URL) returns Error 403 - Forbidden
If gamestop has a help forum you should try there. It is their server generating the error.
Last edited by dbasnett; Sep 21st, 2020 at 11:53 AM.
-
Sep 21st, 2020, 09:49 AM
#10
Re: WebClient.DownloadString(URL) returns Error 403 - Forbidden
Originally Posted by dbelley_office
Render Unavailable from California is weird. GameStop is in USA.
Where are you located? I am in Canada and from here it works in all browser.
I can't connect from major EU countries - all are forbidden. Anyway your code is OK and works with other sites. Seems there are some other checks some web-dev added to gamestop web site.
-
Sep 21st, 2020, 09:56 AM
#11
Re: WebClient.DownloadString(URL) returns Error 403 - Forbidden
The posted link works for me, here in the US.
My usual boring signature: Nothing
-
Sep 21st, 2020, 10:03 AM
#12
Thread Starter
Hyperactive Member
Re: WebClient.DownloadString(URL) returns Error 403 - Forbidden
Originally Posted by Shaggy Hiker
The posted link works for me, here in the US.
Are you able to execute my code for that link?
-
Sep 21st, 2020, 10:14 AM
#13
Re: WebClient.DownloadString(URL) returns Error 403 - Forbidden
Originally Posted by peterst
I can't connect from major EU countries - all are forbidden. Anyway your code is OK and works with other sites. Seems there are some other checks some web-dev added to gamestop web site.
Yep, same for me, I get :
Access Denied
You don't have permission to access "http://www.gamestop.com/" on this server. Reference #18.9d711602.1600701220.2e547d4c
I tried with a proxy and got the same result.
The best friend of any programmer is a search engine
"Don't wish it was easier, wish you were better. Don't wish for less problems, wish for more skills. Don't wish for less challenges, wish for more wisdom" (J. Rohn)
“They did not know it was impossible so they did it” (Mark Twain)
-
Sep 29th, 2020, 09:22 PM
#14
Re: WebClient.DownloadString(URL) returns Error 403 - Forbidden
I got Access Denied here in England
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
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
|