title: Connecting Google News
body: <p>I've had been using the following piece of code to retrieve Google News:</p>
  
  <pre><code>def gopen(dom):
    http = httplib.HTTPSConnection('news.google.com')
    http.request("GET","/news?ned=es_%s" % dom.lower(),
                  headers =
                 {"User-Agent":"Mozilla/5.0 (X11; U; Linux i686; es-%s) AppleWebKit/532.8 (KHTML, like Gecko) Chrome/4.0.277.0 Safari/532.8" % dom,
                 "Host":'news.google.com',
                 "Accept": "*/*"})
    return http.getresponse()
  </code></pre>
  
  <p>A few days ago, Google News has been revamped and it doesn't work any more (2.6/Win, 2.7/OSX and, with minimal changes, 3.6/Win). How can I fix it? I must stick to the standard libraries.</p>
  
  <p><strong>EDIT.</strong> The headers are:</p>
  
  <pre><code>[('Content-Type', 'application/binary'),
   ('Cache-Control', 'no-cache, no-store, max-age=0, must-revalidate'),
   ('Pragma', 'no-cache'),
   ('Expires', 'Mon, 01 Jan 1990 00:00:00 GMT'),
   ('Date', 'Thu, 13 Jul 2017 16:37:48 GMT'),
   ('Location', 'https://news.google.com/news/?ned=es_mx&amp;hl=es'),
   ('Strict-Transport-Security', 'max-age=10886400'),
   ('P3P',
    'CP="This is not a P3P policy! See '
   'https://support.google.com/accounts/answer/151657?hl=en for more info."'),
   ('Server', 'ESF'),
   ('Content-Length', '0'),
   ('X-XSS-Protection', '1; mode=block'),
   ('X-Frame-Options', 'SAMEORIGIN'),
   ('X-Content-Type-Options', 'nosniff'),
   ('Set-Cookie', 'NID=107=qwH7N2hB12zVGfFzrAC2CZZNhrnNAVLEmTvDvuSzzw6mSlta9D2RDZVP9t5gEcq_WJjZQjDSWklJ7LElSnAZnHsiF4CXOwvGDs2tjrXfP41LE-6LafdA86GO3sWYnfWs;Domain=.google.com;Path=/;Expires=Fri, '
   '12-Jan-2018 16:37:48 GMT;HttpOnly'),
   ('Alt-Svc', 'quic=":443"; ma=2592000; v="39,38,37,36,35"')]
  </code></pre>
  
  <p><code>read()</code>returns an empty string. <code>status</code> is 302. <code>reason</code> is <code>Found</code>.</p>