connection time out

This script worked fine, but it suddenly doesn't work this morning. The contents of the error are as follows. Is it possible to check?

Traceback (most recent call last): File "/usr/lib/python3.6/urllib/", line 1318, in do_open encode_chunked=req.has_header('Transfer-encoding')) File "/usr/lib/python3.6/http/", line 1254, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/lib/python3.6/http/", line 1300, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/usr/lib/python3.6/http/", line 1249, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/lib/python3.6/http/", line 1036, in _send_output self.send(msg) File "/usr/lib/python3.6/http/", line 974, in send self.connect() File "/usr/lib/python3.6/http/", line 946, in connect (,self.port), self.timeout, self.source_address) File "/usr/lib/python3.6/", line 724, in create_connection raise err File "/usr/lib/python3.6/", line 713, in create_connection sock.connect(sa) TimeoutError: [Errno 110] Connection timed out During handling of the above exception, another exception occurred:

    import urllib.request
    from urllib.parse import urlparse

    with urllib.request.urlopen('') as requrl:
        res_body ='utf-8')
    soup = BeautifulSoup(res_body, 'html.parser')

Does it happen only on PythonAnywhere? What if you try that on your local machine?

It works on my local machine. Please check what changes have been made to the server environment. Firewall .. etc..

url : port : 8081

We have not made any changes, but it is possible that the site in question is limiting connections from our servers or that there is some sort of network filtering going on. My experiments suggest that that is what is going on. There is, unfortunately, nothing that we can do about it - particularly if the site is responding to behaviour from PythonAnywhere that they are interpreting as abusive.

Can I know my server IP? I'll request to open firewall to them (target service vendor)

And can you check my firewall policy?

from pythonanywhere my server


port 8081

The following url is the service url I've been using and it works fine.

We are not limiting your ability to connect to the site. We do not (except in very specific circumstances) interfere with outgoing connections from paid accounts. If you cannot connect to the site, it is not because of something that we're doing and so we cannot undo it.

I asked if there were any limitations from the service vendor, and they replied that there are no limitations because they are OPEN API If so, what is the problem? Can I do outbound network checks in pythonanywhere? If I change it to a different url (e.g. in the source code, it works fine. only this url does not work.

It's not happening on our side.

enter image description here

I think the firewall is blocked, and the Python Anywhere side or target service side. Is any command like 'netstat'

not sure about this one- it's possible that service side is blocking typical cloud hosting ips