Use etree.tostring 'method' arg
Gives appropriately formatted html code. Some pages might otherwise be rendered as blank.
This commit is contained in:
@@ -341,7 +341,7 @@ def get_article(data, url=None, encoding_in=None, encoding_out='unicode', debug=
|
||||
if url:
|
||||
best.make_links_absolute(url)
|
||||
|
||||
return lxml.etree.tostring(best if not debug else html, pretty_print=True, encoding=encoding_out)
|
||||
return lxml.etree.tostring(best if not debug else html, method='html', encoding=encoding_out)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Reference in New Issue
Block a user