Re: [Tutor] Python 3 simple socket issue

2015-02-18 Thread Juan C.
The code is fine, the email should have ruined the indentation. Anyway, indeed, I only saw the 403 error and didn't even read the rest as I thought it was only HTML/CSS code, my bad. Tried with other pages and everything is working, thanks. ___ Tutor mai

Re: [Tutor] Python 3 simple socket issue

2015-02-18 Thread Dave Angel
On 02/18/2015 10:48 AM, Juan C. wrote: Code: # !/usr/bin/env python3 # -*- coding: utf-8 -*- import socket def main(): target_host = 'www.google.com' target_port = 80 client = socket.socket() client.connect((target_host, target_port)) client.send(b"GET HTTP/1.1\r\nHost:google.com\r\n\r\n") r

Re: [Tutor] Python 3 simple socket issue

2015-02-18 Thread Zachary Ware
On Wed, Feb 18, 2015 at 9:48 AM, Juan C. wrote: > We\'re sorry.. but your computer or network may be > sending automated queries. To protect our users, we can\'t process your > request right now.See https://support.google.com/websearch/answer/86640";>Google Help for more > information.https://

[Tutor] Python 3 simple socket issue

2015-02-18 Thread Juan C.
Code: # !/usr/bin/env python3 # -*- coding: utf-8 -*- import socket def main(): target_host = 'www.google.com' target_port = 80 client = socket.socket() client.connect((target_host, target_port)) client.send(b"GET HTTP/1.1\r\nHost:google.com\r\n\r\n") response = client.recv(4096) print(respons