Skip to content

How to select an html element based on his text content? #2

Description

@sebbbastien

What should be the selector for this kind of html code:

<h2>Firstname</h2>
<p>John</p>
<!--- some random html code, with random h2 tags -->
<h2>Lastname</h2>
<p>Doe</p>

I would like to fill this struct:

type Person struct {
    Firstname string `pagser:"h2[text=Firstname]+p"`
    Lastname  string `pagser:"h2[text=Lastname]+p"`
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions