import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(("example.com", 80)) s.send(b"GET / HTTP/1.1\r\nHost: example.com\r\n\r\n") response = s.recv(4096) print(response.decode("utf-8")) s.close()In this example, we create a socket object and connect to the example.com domain on port 80. We then send a GET request and receive a response using the `recv()` method. Finally, we close the socket connection with `close()`. Package library: `socket` module is built-in to Python standard library.