-
Notifications
You must be signed in to change notification settings - Fork 294
AttributeError: 'TreeWalker' object has no attribute 'fragmentChildren' #228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Milestone
Comments
Where does your tree object come from? (We should probably add an |
I narrowed down the problem to: from lxml.html import fromstring
from html5lib import treewalkers, serializer
lxmltree = fromstring('<div><div></div></div>')
walker = treewalkers.getTreeWalker('lxml')
stream = walker(lxmltree)
s = serializer.htmlserializer.HTMLSerializer()
output = s.render(stream) Which gives: Traceback (most recent call last):
File "html5fail.py", line 9, in <module>
output = s.render(stream)
File "<path>/html5lib-python/html5lib/serializer/htmlserializer.py", line 306, in render
return "".join(list(self.serialize(treewalker)))
File "<path>/html5lib-python/html5lib/serializer/htmlserializer.py", line 196, in serialize
for token in treewalker:
File "<path>/html5lib-python/html5lib/filters/optionaltags.py", line 17, in __iter__
for previous, token, next in self.slider():
File "<path>/html5lib-python/html5lib/filters/optionaltags.py", line 9, in slider
for token in self.source:
File "<path>/html5lib-python/html5lib/treewalkers/_base.py", line 150, in __iter__
currentNode = self.getParentNode(currentNode)
File "<path>/html5lib-python/html5lib/treewalkers/lxmletree.py", line 202, in getParentNode
elif node in self.fragmentChildren:
AttributeError: 'TreeWalker' object has no attribute 'fragmentChildren' Python 3.5.1 |
gsnedders
added a commit
to gsnedders/html5lib-python
that referenced
this issue
May 22, 2016
gsnedders
added a commit
to gsnedders/html5lib-python
that referenced
this issue
May 25, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For some reason my
tree
(lxml.etree._Element
) object has no attribute getroot and is not a list so there is nofragmentChildren
attribute onTreeWalker
: 270a2calxml 3.5.0
html5lib-python f796cca
The text was updated successfully, but these errors were encountered: