Skip to content

Get text of element without children #196

@latot

Description

@latot

Hi all, I was trying to get some text from a element, then I noticed that seems there is no way to get the inner html of a element excluding the childrens, for example:

<div>
  <p>Hi</p>
  Bye
</div>

Get the Bye is pretty hard..., Childrens are only html tags, so Bye can't be detected easily, nor excluded from a iterator.

I don't think the best solution is just return a String, because:

<div>
  Bye2
  <p>Hi</p>
  Bye
</div>

Would be hard to know how to get well things like that ones... I don't know which solution would be good and clear for this.... Maybe an iterator that in their childrens, the text are also childrens, so we can work on it.

Thx!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions