dperini / nwsapi

Fast CSS Selectors API Engine
MIT License
105 stars 36 forks source link

querySelector > E #65

Closed za-ek closed 1 year ago

za-ek commented 1 year ago

Hi! This is my case:

...
<div id="my-id">
   <div>
      <a><span/></a>
      .... any number of a > span
      <span>
   </div>
   ... any number of the same structure
   <div>...</div>
</div>
...

I need separate values from a>span and div>span within function that holds ('#my-id') I use function:

[...doc.querySelectorAll('#my-id > div')].map(row => {{
    rows: row.querySelectorAll('a > span') // ok, found all <a>
    root: row.querySelector(?)
}});

I have tried: > span, span:root, span:not(a > span) that are not valid and span:last-child,span:last-of-type that return span inside first tag

How do I find the tag inside the row?

dperini commented 1 year ago

@za-ek there seems to be no issue here. So I am closing this. Hope you found a way to do what you need. If that's not the case use a forum instead of filling an issue for a bug.