title: HTTPError: HTTP Error 403: Forbidden
body: <p>I making a python script for personal use but it's not working for wikipedia...</p>
  
  <p>This work:</p>
  
  <pre><code>import urllib2, sys
  from bs4 import BeautifulSoup
  
  site = "http://youtube.com"
  page = urllib2.urlopen(site)
  soup = BeautifulSoup(page)
  print soup
  </code></pre>
  
  <p>This not work:</p>
  
  <pre><code>import urllib2, sys
  from bs4 import BeautifulSoup
  
  site= "http://en.wikipedia.org/wiki/StackOverflow"
  page = urllib2.urlopen(site)
  soup = BeautifulSoup(page)
  print soup
  </code></pre>
  
  <p>This is the error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Python27\wiki.py", line 5, in &lt;module&gt;
      page = urllib2.urlopen(site)
    File "C:\Python27\lib\urllib2.py", line 126, in urlopen
      return _opener.open(url, data, timeout)
    File "C:\Python27\lib\urllib2.py", line 406, in open
      response = meth(req, response)
    File "C:\Python27\lib\urllib2.py", line 519, in http_response
      'http', request, response, code, msg, hdrs)
    File "C:\Python27\lib\urllib2.py", line 444, in error
      return self._call_chain(*args)
    File "C:\Python27\lib\urllib2.py", line 378, in _call_chain
      result = func(*args)
    File "C:\Python27\lib\urllib2.py", line 527, in http_error_default
      raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
  HTTPError: HTTP Error 403: Forbidden
  </code></pre>