Merge multiple child elements as single record

I have HTML that I am trying to scrape into a single record. It's basically structured like this.

<div attribute="scrapethis">
    <div attribute="include">
    ...
    </div>
    <div attribute="include">
    ...
    </div>
    <div attribute="dontinclude">
    ...
    </div>
</div>

I'd like to scrape the HTML of all elements that match the "include" attribute but not the elements that match the "dontinclude" element and merge all of the HTML into a single record. Is that possible?

I've tried creating elements like this, but it only returns the first "include" element. (I've also tried enabling and disabling the "multiple" setting for parent and child).
Parent: Element selector, div[attribute="scrapethis"]
Child: HTML selector, div[attribute="include"]

It is not possible to scrape HTML elements like that, but you can do it with grouped selector:
div[attribute="include"]

The scraper will return content from each element that contains "include" attribute in one field in json format.

2 Likes