I am trying to select an element attribute which is part of a parent and also together with the child elements.
So far I have no issue if the child elements and the parent are scraped separately. But I need the data to be exported in a single row.
Here is an example of the HTML:
<div class="company" data-label="multinational">
<div class="rank">7</div>
<div class="country">Italy</div>
</div>
The data I need to export in CSV is: Multinational, 7, Italy
Currently I can export the data but they are separate rows:
Multinational
7, Italy
For Element Attribute selector is it possible to select a parent element? I can't seem to select the parent from a child selector.