0

I am using the code below from this anwser.

import urllib.request
url = 'https://example.com'
proxy_support = urllib.request.ProxyHandler({'http' : '37.26.86.206', 
                                             'https': '37.26.86.206'})
opener = urllib.request.build_opener(proxy_support)
urllib.request.install_opener(opener)

with urllib.request.urlopen(url) as response:
    print(response)

However, I get this error: urllib.error.URLError: <urlopen error Remote end closed connection without response> I don't know why this is, because other people didn't have this problem (that I can find). Is this a problem with my proxy, or is it a problem with the code?
Note: All tracebacks are through urllib, and not my program

  • free proxies often are outdated and they don't work. And some portals already know free proxies and they may blocks them. Better find some paid proxies or maybe use [tor](https://www.torproject.org/) as proxy. OR use services like [scrapestack.com](http://scrapestack.com?utm_source=FirstPromoter&utm_medium=Affiliate&fpr=f9nhn) which gives few free requests every month (ie. 250) – furas Aug 19 '21 at 12:05

1 Answers1

0

I believe the problem was I didn't have a port with the IP. It is fixed now.