I\'m trying to get some data from a page, but it\'s returning the error [403 Forbidden].
I thought it was the user agent, but I tri
The site could be using anything in the request to trigger the rejection.
So, copy all headers from the request that your browser makes. Then delete them one by one1 to find out which are essential.
As per Python requests. 403 Forbidden, to add custom headers to the request, do:
result = requests.get(url, headers={'header':'value', })
1A faster way would be to delete half of them each time instead but that's more complicated since there are probably multiple essential headers