Open wooque opened 2 weeks ago
Commenting to indicate another case where the lexbor
causes segmentation fault but modest
works:
Causes segmentation fault:
import selectolax
parser = selectolax.lexbor.LexborHTMLParser("")
for node in parser.root.traverse():
parent = node.parent.attributes.get("anything")
print("done")
Works as expected:
import selectolax
parser = selectolax.parser.HTMLParser("")
for node in parser.root.traverse():
parent = node.parent.attributes.get("anything")
print("done")
In lexbor the issue seems to be that when generating html elements the parents of those generated elements won't have .attributes
in some cases
Here is the script that reproduces the crash
It crashes when trying to access attributes of 3rd comment