get a 403 error in python requests while using proxy

I’m trying to access a page with python requests library with proxy.

But i get a 403 error.

I tried different pages and still got the same error.

Also know that my proxy is working well, i tried different correct proxies and still got the same error.(i checked every proxy here)

Here is my code:

import requests
import socket

URL = ""
    "Host": URL,
    "ACCEPT-LANGUAGE": "en-US,en;q=0.9,fa-IR;q=0.8,fa;q=0.7,la;q=0.6",
    "USER-AGENT": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) "
                  "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36"
    "http": ""
IP = socket.gethostbyname(URL)

response = requests.get(f"http://{IP}", headers=HEADER, proxies=PROXY, verify=False)

The error content:

Traceback (most recent call last):
  File "/Users/ali/Desktop/cdn-detection/", line 27, in <module>
  File "/Users/ali/Desktop/cdn-detection/venv/lib/python3.9/site-packages/requests/", line 953, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url:


Error 403 means forbidden you can find more information about it here

Since your using a proxy too this could mean the page could be blocking proxies (unless its your own page then maybe not). I think its best to switch to a few different proxies and see if the issue persists.