2 years ago

#75401

test-img

Usman Fawad

requests.exceptions.ProxyError: HTTPSConnectionPool(host='zillow.com', port=443): Error on PythonAnywhere

I hosted a web-application on PythonAnywhere. This application involves scraping data from https://www.zillow.com. The issue that I encountered is that when I run this application and enter data, it throws this error:

requests.exceptions.ProxyError: HTTPSConnectionPool(host='zillow.com', port=443):

My code to scrape data from this website worked perfectly fine locally. Then I read somewhere that maybe Zillow isn't a whitelisted website on PythonAnywhere. I did request them to add this website to their list. This is the code that I used to send a request using p

    p_address_input = str(par1) + ", " + str(par2) + " " + str(par3) + ", " + str(par4)
    url = "https://zillow.com/homes/" + p_address_input
    #property address will be its parameter
    headers = {
        "scheme": "https",
        "accept": "*/*",
        "accept-encoding": "gzip, deflate, br",
        "accept-language": "en-US,en;q=0.9",
        "path":"/ajax/homedetail/MarkPropertyViewed.htm?zpid=50141969",
        "user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36",
        "content-type": "application/json;charset=UTF-8",
        "sec-ch-ua-mobile": "?0",
        "sec-ch-ua-platform": "Windows",
        "sec-fetch-dest": "empty",
        "sec-fetch-mode": "cors",
        "sec-fetch-site": "same-origin",
        "pragma": "no-cache",
        }
    r = requests.get(url,headers=headers)

I am currently using PythonAnywhere's free package. If I upgrade to a paid one, will I face the same issue? Any help would be appreciated.

python

python-requests

pythonanywhere

0 Answers

Your Answer

Accepted video resources