requests.exceptions.ConnectionError: ('Connection aborted.', error(104, 'Connection reset by peer'))

Hi, I have this error but the same script is working fine for my local python

requests.exceptions.ConnectionError: ('Connection aborted.', error(104, 'Connection reset by peer'))

I am using this command when it failed

url = requests.get('')

can you access other websites okay?

others website works well in pythonanywhere. Only this link that works in my local PC came out with this error

Where are you running the code? That is, is it happening in a web app, a console, or a scheduled task?

I'm wondering if that site might have blocked one of the IP addresses that our servers use. I was successfully able to run the same code from a number of our servers, but there are a large number and it's possible that just one of them has been blocked.

Hi giles,

I run in a console to test it out.

Hm. I just tested from all our console servers and I'm able to get through just fine, so I don't think it's a specific IP address block.

Is the problem still happening? Are you sure it's coming from that exact line of code?

change to another console able to work. But my concern will be when I want to put it in schedule run, will this type of issue happen again?

If it's the target site placing blocks on you, we have no control over that. But since the issue stopped happening, I guess the block was only temporary. I guess the best thing to do is just try it and find out?