You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
contents() method is extremely useful to deal with a node that has text node child.
However, it seems that can't generate correct childnodes in that following case.
Consider
from pyquery import PyQuery as pq
html = '''<span>123<br>...456<br>...789</span>'''
doc = pq(html)
childnodes = doc.contents()
print('sub-node count by contents(): ', childnodes.size())
for childnode in childnodes.items():
pass
print(childnode)
We can find that the 2nd sub-node and the 3rd one are coupled, and so are the 4th and the 5th.
I am not sure it is a bug. Can anybody have a look at this?
In addition, why the original text nodes are wrapped with a
tag automatically? It seems a redundant action.
The text was updated successfully, but these errors were encountered:
contents() method is extremely useful to deal with a node that has text node child.
However, it seems that can't generate correct childnodes in that following case.
Consider
It will yield
We can find that the 2nd sub-node and the 3rd one are coupled, and so are the 4th and the 5th.
I am not sure it is a bug. Can anybody have a look at this?
In addition, why the original text nodes are wrapped with a
tag automatically? It seems a redundant action.
The text was updated successfully, but these errors were encountered: