title: Why does text retrieved from pages sometimes look like gibberish?
body: <p>I'm using urllib and urllib2 in Python to open and read webpages but sometimes, the text I get is unreadable. For example, if I run this:</p>
  
  <pre><code>import urllib
  
  text = urllib.urlopen('http://tagger.steve.museum/steve/object/141913').read()
  print text
  </code></pre>
  
  <p>I get some unreadable text. I've read these posts: </p>
  
  <p><a href="https://stackoverflow.com/questions/7964726/gibberish-from-urlopen">Gibberish from urlopen</a></p>
  
  <p><a href="https://stackoverflow.com/questions/3947120/dose-python-urllib2-will-automaticly-uncompress-gzip-data-from-fetch-webpage">Does python urllib2 automatically uncompress gzip data fetched from webpage?</a></p>
  
  <p>but can't seem to find my answer.</p>
  
  <p>Thank you in advance for your help!</p>
  
  <hr>
  
  <p>UPDATE: I fixed the problem by 'convincing' the server that my user-agent is a brower and not a crawler. </p>
  
  <pre><code>import urllib
  
  class NewOpener(urllib.FancyURLopener):
    version = 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.2 (KHTML, like Gecko) Ubuntu/11.10 Chromium/15.0.874.120 Chrome/15.0.874.120 Safari/535.2'
  
  nop = NewOpener()
  html_text = nop.open('http://tagger.steve.museum/steve/object/141913').read()
  </code></pre>
  
  <p>Thank you all for your replies.</p>