newbie problem: use socke lib to retrieve one web page:
Gerhard Häring
gerhard.haering at opus-gmbh.net
Thu Sep 5 07:36:42 EDT 2002
koko wrote:
> I write this to retrieve one web page using socket lib.
>
> # retrieve webpage
> import socket
> HOST='www.uic.edu' # remote host
> PORT=80 # remort port
> s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> m="""GET /home/events.shtml HTTP/1.0
> From: hh at uic.edu
> User-Agent: test/1.0
> """
> [...]
You're missing the empty line that terminates a HTTP 1.0 or later HTTP
request.
-- Gerhard
More information about the Python-list
mailing list