Skip to content

Can’t scrap untagged html element  #266

Open
@Flashby2

Description

@Flashby2

Hello,

I'm in a rather tricky situation because after numerous unsuccessful attempts and searches, I'm unable to retrieve the following element, which seems quite trivial. I'm trying to retrieve the string "2h43", but it doesn't seem to belong to any nodes. I've tried testing the outerHTML and the different siblings, but to no avail.

let html = "<strong><u>Durée</u> : </strong>02h43<br>"

Here's my line that should work:

let element: Element = try doc.select("strong:contains(Durée)").first()!

let durationText = try element.nextElementSibling()!.text()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions