title: 401 - Unauthorized: Access is denied due to invalid credentials python
body: <pre><code>import urllib2
  proxy = urllib2.ProxyHandler({ "http" : "http:proxyIp1", "https" : "proxyIp2"})
  opener = urllib2.build_opener(proxy)
  urllib2.install_opener(opener)
  try:
      a = urllib2.urlopen("corporate internal link")#, proxies=proxy)
      b = a.read()
  except urllib2.HTTPError as e:
      error = e.read() # this will be your error message
      print error
  </code></pre>
  
  <p>This gives an error:</p>
  
  <pre><code>401 - Unauthorized: Access is denied due to invalid credentials.
  </code></pre>
  
  <p>I know that i have to give "username" and "password" but can any1 tell how i can give the credentials in this case??
  Thanks</p>