sockets
archana sambandam
archan_sams at yahoo.co.in
Fri Jan 20 02:28:10 EST 2006
the following code works perfectly
import socket, sys
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("www.python.org", 80))
s.send("GET")
while 1:
buf = s.recv(1000)
if not buf:
break
sys.stdout.write(buf)
s.close()
but the following code does not work
import socket, sys
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("http://www.google.co.in/search?hl=en&q=india&meta=", 80))
s.send("GET")
while 1:
buf = s.recv(1000)
if not buf:
break
sys.stdout.write(buf)
s.close()
the given url is the google search url for the string india.can u suggest some way to access the google search result page through SOCKETS.
Send instant messages to your online friends http://in.messenger.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060120/e3f8cefd/attachment.html>
More information about the Python-list
mailing list