Skip to content

Get next element #668

Answered by ziflex
JohnnyQQQQ asked this question in Q&A
Discussion options

You must be logged in to vote

Try something like this

LET elements = ELEMENTS(doc, '#container span')

FOR el, i IN elements
    FILTER ROUND(i/2) == i/2
    
    LET key = el.innerText
    LET sibling = elements[i+1]
    LET value = sibling.innerText
    
    RETURN { [text]: value }

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by ziflex
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
type/question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #312 on September 20, 2021 00:32.