feeds: make BS's output bytes for lxml's sake
parent
3617f86e9d
commit
568e7d7dd2
|
@ -442,7 +442,7 @@ class ParserHTML(ParserXML):
|
||||||
|
|
||||||
def parse(self, raw):
|
def parse(self, raw):
|
||||||
parser = etree.HTMLParser(remove_blank_text=True) # remove_blank_text needed for pretty_print
|
parser = etree.HTMLParser(remove_blank_text=True) # remove_blank_text needed for pretty_print
|
||||||
return etree.fromstring(BeautifulSoup(raw, 'lxml').prettify(), parser)
|
return etree.fromstring(BeautifulSoup(raw, 'lxml').prettify('utf-8'), parser)
|
||||||
|
|
||||||
def tostring(self, encoding='unicode', **k):
|
def tostring(self, encoding='unicode', **k):
|
||||||
return lxml.html.tostring(self.root, encoding=encoding, **k)
|
return lxml.html.tostring(self.root, encoding=encoding, **k)
|
||||||
|
|
Loading…
Reference in New Issue