Open acdha opened 11 years ago
There are two problem in this issue:
p = pq('<div>').append('footbar')
print(p) # this will be fine
However, first if you call
print(p.contents())
There will be error that: Type 'lxml.etree._ElementUnicodeResult' cannot be serialized. Since the p content will return a list in unicode result, and tostring cannot apply on it.
and the second one is the reported one: tag is a lxml.html.Element and root is a ElementUnicodeResult, and unicode object cannot convert to Element directly.
Using pyquery 1.2.4 with Python 3.3.0 on OS X 10.8: