title: Http Error 302 in python
body: <p>So while using urllib I get this error, here is the full traceback:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\user\Desktop\Dads project\Word search tool.py", line 
  148, in &lt;module&gt;
   print_absolute_counts(line.strip('\n'), 'english', smoothing=0, 
   start_year=1799, end_year=1801)
  File "C:\Users\user\Desktop\project\Word search tool.py", line 43, in 
  print_absolute_counts
      absolute_counts = retrieve_absolute_counts(token, corpus, smoothing, 
  start_year, end_year)
  File "C:\Users\user\Desktop\Dads project\Word search tool.py", line 85, in 
  retrieve_absolute_counts
     page = urllib.request.urlopen(urllib.request.Request(url)).read()
    File "C:\Users\user\AppData\Local\Programs\Python\Python37- 
   32\lib\urllib\request.py", line 222, in urlopen
     return opener.open(url, data, timeout)
  File "C:\Users\user\AppData\Local\Programs\Python\Python37- 
  32\lib\urllib\request.py", line 531, in open
  response = meth(req, response)
   File "C:\Users\user\AppData\Local\Programs\Python\Python37- 
    32\lib\urllib\request.py", line 641, in http_response
  'http', request, response, code, msg, hdrs)
    File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 563, in error
  result = self._call_chain(*args)
   File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 503, in _call_chain
  result = func(*args)
   File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 755, in http_error_302
  return self.parent.open(new, timeout=req.timeout)
   File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 531, in open
  response = meth(req, response)
   File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 641, in http_response
  'http', request, response, code, msg, hdrs)
    File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 563, in error
  result = self._call_chain(*args)
    File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 503, in _call_chain
  result = func(*args)
   File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 755, in http_error_302
  return self.parent.open(new, timeout=req.timeout)
    File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 531, in open
  response = meth(req, response)
    File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 641, in http_response
  'http', request, response, code, msg, hdrs)
   File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 563, in error
  result = self._call_chain(*args)
    File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 503, in _call_chain
  result = func(*args)
   File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 755, in http_error_302
  return self.parent.open(new, timeout=req.timeout)
    File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 531, in open
  response = meth(req, response)
    File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 641, in http_response
  'http', request, response, code, msg, hdrs)
    File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 563, in error
  result = self._call_chain(*args)
    File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 503, in _call_chain
  result = func(*args)
    File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 755, in http_error_302
  return self.parent.open(new, timeout=req.timeout)
    File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 531, in open
  response = meth(req, response)
    File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 641, in http_response
  'http', request, response, code, msg, hdrs)
    File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 563, in error
  result = self._call_chain(*args)
    File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 503, in _call_chain
  result = func(*args)
    File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 745, in http_error_302
     self.inf_msg + msg, headers, fp)
  urllib.error.HTTPError: HTTP Error 302: The HTTP server returned a redirect error that would lead to an infinite loop.
  The last 30x error message was:
  </code></pre>
  
  <p>Found
  I want to know if their is a way to fix this, it comes as I search something in a website and it returns this, other searches appear to work perfectly, but this one specific search being: aaliis returns an error, its a sort of word search for the google ngrams.</p>