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/request.py", line 1318, in do_open encode_chunked=req.has_header('Transfer-encoding')) File "/usr/lib/python3.6/http/client.py", line 1254, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/lib/python3.6/http/client.py", line 1300, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/usr/lib/python3.6/http/client.py", line 1249, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/lib/python3.6/http/client.py", line 1036, in _send_output self.send(msg) File "/usr/lib/python3.6/http/client.py", line 974, in send self.connect() File "/usr/lib/python3.6/http/client.py", line 946, in connect (self.host,self.port), self.timeout, self.source_address) File "/usr/lib/python3.6/socket.py", line 724, in create_connection raise err File "/usr/lib/python3.6/socket.py", 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('http://openapi.molit.go.kr:8081/OpenAPI_ToolInstallPackage/service/rest/RTMSOBJSvc/getRTMSDataSvcAptTrade?ServiceKey=zNxtEJ7mbW0rTQsioiKuO4k%2BgsHwS4owhi7fULI7XOcjqB%2FDWm0gactlYSBceX7aP3DgDi3acU07a%2F%2BYk9dCog%3D%3D&LAWD_CD=11680&DEAL_YMD=202105') as requrl:
res_body = requrl.read().decode('utf-8')
soup = BeautifulSoup(res_body, 'html.parser')