Skip to content

Cannot select the current element inside extract #4966

@T0nd0Tara

Description

@T0nd0Tara

Some times you have a structure like

<div>
  <a href="www.google.com">
    <div class="info">Google</div>
  </a>
  <a href="www.duckduckgo.com">
    <div class="info">Duck Duck Go</div>
  </a>
</div>

It'd be convenient to be able to do something like

$.extract({
  engines: [{
    selector: "div > a",
    value: {
      url: {
        selector: ":scope", // <-- Here is the problem
        value: "href"
      },
      info: '.info'
    }
  }]
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions