import socket
target_host = "www.google.com"
target_port = 80
#建立一個socket對象
client = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
#連接客戶端
client.connect((target_host,target_port))
#發送數據
client.send("GET/HTTP/1.1\r\nHost:google.com\r\n\r\n")
#接受一些數據
response = client.recv(4096)
print response