Closed danisty closed 1 year ago
I'd like to reopen this issue since the merged pr doesn't fix it. The relaxed
property should be passed to the DocElement constructor for the methods mentioned before: children
, siblings
, allElements
and parents
.
Ok thanks for pointing this out 👍
Describe the bug Getting the
children
of a Doc/DocElement will call the public constructor of DocElement and setrelaxed
to false, thus making all children throw an exception if a query selection fails.Also happens for
siblings
,allElements
andparents
.Code Sample
https://github.com/skrapeit/skrape.it/blob/95c326f7eee0899c707f6f9bf2367a68fd80e502/html-parser/src/main/kotlin/it/skrape/selects/DomTreeElement.kt#L48-L50 https://github.com/skrapeit/skrape.it/blob/95c326f7eee0899c707f6f9bf2367a68fd80e502/html-parser/src/main/kotlin/it/skrape/selects/DocElement.kt#L8-L12
Expected behavior Inherit the relaxed property.