I am trying to concatenate two selectors with different parents. The first selector currently in use is:
..css('td:nth-child(8) > span.cap.mtv > ::text')
This returns:
<Selector xpath="descendant-or-self::td[count(preceding-sibling::*) = 7]/span[@class and contains(concat(' ', normalize-space(@class), ' '), ' cap ') and (@class and contains(concat(' ', normalize-space(@class), ' '), ' mtv '))]/*/text()" data='$725,000'>
The problem arises when I try to include the following second selector:
..xpath('td[8]/div/text()')
Displaying:
<Selector xpath='td[8]/div/text()' data='UFA'>
My ultimate goal is to utilize an item loader and extract the following:
$725,000
UFA
...
I would like to achieve a similar outcome by using the following approach:
...xpath('td[8]').css('span.cap.mtv > ::text').xpath('/div/text()')
In the past, I have resorted to rescraping elements with a new set of selectors if nothing was found initially. However, I prefer to have this kind of 'either/or' flexibility. Should I consider a completely different selector for this scenario?
Your assistance is greatly appreciated!