Skip to content

Get direct descendent text only when calling text() on a node. #42294

@Bilge

Description

@Bilge

Description
Get direct descendent text only when calling text() on a node.

Example
When an HTML node contains mixed text and element nodes, it is difficult to get just the text of the current node, since the text() call will also recursively parse all descendents.

<foo>
    foo
    <bar>bar</bar>
</foo>

When we have a Crawler instance pointing at <foo>, calling text() will return foo bar. There is no way to get just the direct descendent text node, foo.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions