title: How can I make a simple web browser on python 3.6?
body: <p>So far this is what I have and every place I've looked it says this code should work but it doesn't.</p>
  
  <pre><code>import socket
  
  mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  mysock.connect(('data.pr4e.org', 80))
  mysock.send(b'GET http://data.pr4e.org/romeo.txt HTTP/1.0\n\n')
  
  while True:
      data = mysock.recv(512)
      if ( len(data) &lt; 1 ) :
          break
      print (data)
  
  mysock.close()
  </code></pre>
  
  <p>This is the output I get back:</p>
  
  <pre><code>b'HTTP/1.1 400 Bad Request\r\nDate: Sun, 25 Nov 2018 19:23:51 GMT\r\nServer: 
  Apache/2.4.18 (Ubuntu)\r\nContent-Length: 308\r\nConnection: 
  close\r\nContent-Type: text/html; charset=iso-8859-1\r\n\r\n&lt;!DOCTYPE HTML 
  PUBLIC "-//IETF//DTD HTML 2.0//EN"&gt;\n&lt;html&gt;&lt;head&gt;\n&lt;title&gt;400 Bad 
  Request&lt;/title&gt;\n&lt;/head&gt;&lt;body&gt;\n&lt;h1&gt;Bad Request&lt;/h1&gt;\n&lt;p&gt;Your browser sent a 
  request that this server could not understand.&lt;br 
  /&gt;\n&lt;/p&gt;\n&lt;hr&gt;\n&lt;address&gt;Apache/2.4.18 (Ubuntu) Server at do1.dr-chuck.com 
  Port 80&lt;/address&gt;\n&lt;/body&gt;&lt;/html&gt;\n'
  </code></pre>
  
  <p>This is what the example says i should get back:</p>
  
  <pre><code>HTTP/1.1 200 OK
  Date: Sun, 14 Mar 2010 23:52:41 GMT
  Server: Apache
  Last-Modified: Tue, 29 Dec 2009 01:31:22 GMT
  ETag: "143c1b33-a7-4b395bea"
  Accept-Ranges: bytes
  Content-Length: 167
  Connection: close
  Content-Type: text/plain
  But soft what light through yonder window breaks
  It is the east and Juliet is the sun
  Arise fair sun and kill the envious moon
  Who is already sick and pale with grief
  </code></pre>
  
  <p>Why don't I get the same output?</p>