title: The result of requests module is different between idle and code
body: <p>Why doesn't the wayback machine return an answer with this code?
  What I tried: (1) python idle returned a normal answer.
  (2) The status_code is 200 and the function returns None.</p>
  <pre><code>def wayback_search(url):
      res = requests.get(&quot;https://web.archive.org/cdx/search/cdx?url=%s&amp;showDupeCount=true&amp;output=json&quot; % url,
                         headers = {'User-agent': 'Mozilla/5.0'})
      ### search in requests_module
      urllist = res.url.split('&amp;')
      request_url = urllist[0][:-1] + '&amp;' + urllist[1] + '&amp;' + urllist[2]
      print('timestamps_url:', request_url)
      res = requests.get(request_url)
      
      if res.raise_for_status():
          cdx = res.json()
          print(res.url)
          print('cdx', cdx)
  
      res = requests.get(&quot;http://archive.org/wayback/available?url=%s&quot; % url,
                         headers = {'User-agent': 'Mozilla/5.0'})
      if res.raise_for_status():
          cdx = res.json()
          print(res.url)
          print('cdx', cdx)
  </code></pre>
  <p>Perhaps the wayback isn't working at all.</p>