Yes, all elements are on the same HTML level. That's why I find this case difficult.
I prefer not to share the URL in public, but I can describe the webpage that I encountered the problem. The webpage is a table of contents of a magazine. They have section headers for each article link, in a format like this:
Section header 1
Article link 1
Article link 2
Section header 2
Article link 3
Article link 4
Article link 5
All section headers are placed on the same HTML level as the articles. Of course, the actual page is more complicated than that - there are complicated internal structure inside each article link block - but the main problem here is each section header is on the same level as the article link block. My goal is to get the article title, article link, and their corresponding section header as a table.
I think the code I provided previously is the simplest example to reproduce this case. For debugging purpose, you can paste the code in <body> of any website and the extension's "Data preview" button should work.