title: Python BeautifulSoup Error
body: <p>I have this script:</p>
  
  <pre><code>import urllib2
  from BeautifulSoup import BeautifulSoup
  import html5lib
  import lxml
  
  soup = BeautifulSoup(urllib2.urlopen("http://www.hitmeister.de").read())
  </code></pre>
  
  <p>But this gives me the following error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "akaConnection.py", line 59, in &lt;module&gt;
      soup = BeautifulSoup(urllib2.urlopen("http://www.hitmeister.de").read())
    File "/usr/lib/pymodules/python2.6/BeautifulSoup.py", line 1499, in __init__
      BeautifulStoneSoup.__init__(self, *args, **kwargs)
    File "/usr/lib/pymodules/python2.6/BeautifulSoup.py", line 1230, in __init__
      self._feed(isHTML=isHTML)
    File "/usr/lib/pymodules/python2.6/BeautifulSoup.py", line 1263, in _feed
      self.builder.feed(markup)
    File "/usr/lib/python2.6/HTMLParser.py", line 108, in feed
      self.goahead(0)
    File "/usr/lib/python2.6/HTMLParser.py", line 148, in goahead
      k = self.parse_starttag(i)
    File "/usr/lib/python2.6/HTMLParser.py", line 226, in parse_starttag
      endpos = self.check_for_whole_start_tag(i)
    File "/usr/lib/python2.6/HTMLParser.py", line 301, in check_for_whole_start_tag
      self.error("malformed start tag")
    File "/usr/lib/python2.6/HTMLParser.py", line 115, in error
      raise HTMLParseError(message, self.getpos())
  HTMLParser.HTMLParseError: malformed start tag, at line 56, column 872
  </code></pre>
  
  <p>Then I tried this code:</p>
  
  <pre><code>soup = BeautifulSoup(urllib2.urlopen("http://www.hitmeister.de").read(),"lxml") 
  </code></pre>
  
  <p>or</p>
  
  <pre><code>soup = BeautifulSoup(urllib2.urlopen("http://www.hitmeister.de").read(),"html5lib")
  </code></pre>
  
  <p>This gives me this error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "akaConnection.py", line 59, in &lt;module&gt;
      soup = BeautifulSoup(urllib2.urlopen("http://www.hitmeister.de").read(),"lxml")
    File "/usr/lib/pymodules/python2.6/BeautifulSoup.py", line 1499, in __init__
      BeautifulStoneSoup.__init__(self, *args, **kwargs)
    File "/usr/lib/pymodules/python2.6/BeautifulSoup.py", line 1230, in __init__
      self._feed(isHTML=isHTML)
    File "/usr/lib/pymodules/python2.6/BeautifulSoup.py", line 1263, in _feed
      self.builder.feed(markup)
    File "/usr/lib/python2.6/HTMLParser.py", line 108, in feed
      self.goahead(0)
    File "/usr/lib/python2.6/HTMLParser.py", line 156, in goahead
      k = self.parse_declaration(i)
    File "/usr/lib/pymodules/python2.6/BeautifulSoup.py", line 1112, in parse_declaration
      j = HTMLParser.parse_declaration(self, i)
    File "/usr/lib/python2.6/markupbase.py", line 109, in parse_declaration
      self.handle_decl(data)
    File "/usr/lib/pymodules/python2.6/BeautifulSoup.py", line 1097, in handle_decl
      self._toStringSubclass(data, Declaration)
    File "/usr/lib/pymodules/python2.6/BeautifulSoup.py", line 1030, in _toStringSubclass
      self.soup.endData(subclass)
    File "/usr/lib/pymodules/python2.6/BeautifulSoup.py", line 1318, in endData
      (not self.parseOnlyThese.text or \
  AttributeError: 'str' object has no attribute 'text'
  </code></pre>
  
  <p>I am running Linux Ubuntu 10.04, Python 2.6.5, BeautifulSoup version is : '3.1.0.1' 
  How can I fix my code, or is there something what I missed?</p>