Forums

OSError('Tunnel connection failed: 403 Forbidden' -- Request to add a website to the list of approved sites

I am trying to scrape data off of websites for learning purposes and to build a project for my portfolio.

I am making the following request in python 3 with the following code.

-------------------------------------------------------------------- code --------------------------------------------------------------------

favicon_url = 'https://www.zillowstatic.com/static-zsg/9c6fb5d/static-zsg/images/favicon.ico'

headers= { 'accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8', 'accept-encoding':'gzip, deflate, sdch, br', 'accept-language':'en-GB,en;q=0.8,en-US;q=0.6,ml;q=0.4', 'cache-control':'max-age=0', 'upgrade-insecure-requests':'1', 'user-agent':'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36' }

res_favicon = requests.get(favicon_url, headers=headers)

-------------------------------------------------------------------- code end --------------------------------------------------------------------

I am getting the following error: " ... cutting out a lot of the top part ... requests.exceptions.ProxyError: HTTPSConnectionPool(host='www.zillowstatic.com', port=443): Max retries exceeded with url: /static-zsg/9c 6fb5d/static-zsg/images/favicon.ico (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden',)"

My understanding is that this is because I can only make requests to approved sites. I saw someone with a similar situation as me on the forums, and the website they were requesting was added to the list of approved sites. If someone from pythonanywhere team could do that for the above url then that'd be much appreciated!