from socket import *
a=0
#while a<1000:
# a= a+1
s = socket(AF_INET, SOCK_STREAM)
s.connect(('leopardan.kr',80))
s.send('GET /URL/URL/index.php HTTP/1.1\r\n')
s.send('Cookie: notice=yes; PHPSESSID=ABCD \r\n')
s.send('Host: leopardan.kr \r\n')
s.send('\r\n')
data = s.recv(1024)
#print data
1.
import httplib
conn = httplib.HTTPConnection('domain/ip',port)
conn.request("GET","/")
res = conn.getresponse()
headers = res.getheaders()
print headers
2.
from socket import *
s = socket(AF_INET, SOCK_STREAM)
s.connect(('domain/ip',port))
s.send('GET / HTTP/1.1\r\n')
s.send('Host: kldp.org\r\n')
s.send('\r\n')
data = s.recv(1024)
print data
http://love-python.blogspot.com/2008/04/get-content-html-source-of-url-by-http.html
출처 : http://skyblog.tistory.com/9
'컴터 때찌 > Programming' 카테고리의 다른 글
[C] pipe function (0) | 2011.01.03 |
---|---|
[php] ls (0) | 2010.12.22 |
[API] CreateWindow - 스크랩 (0) | 2010.12.01 |
Windows Message List (0) | 2010.11.17 |
Leo_K v 2.0 (윈도우 키로거) (0) | 2010.06.16 |