C
C
Cupy2020-06-29 05:59:13
Python
Cupy, 2020-06-29 05:59:13

For years, urllib.request.urlopen, which worked properly for years, began to give a 403 error?

There is a script (on a VPS server) that accesses the API through urllib.request.urlopen and receives data from the service that supplies this data.
For a couple of years everything was smooth, but for some time now some endpoints began to give a 403 error:

urllib.error.HTTPError: HTTP Error 403: Forbidden

options with substitution of different user-agents in headers did not bring results - the error remains the same.
Previously, this was not required at all.
At the same time, through wget, the result is saved without problems.
There is a similar problem on the working machine - everything opens with a browser, the script throws out a 403 error.
What can be done?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2020-06-29
@dimonchik2013

ssl patch
in the normal way, of course, you need to rewrite it for the latest Python

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question