Page 1 of 1

Select row itself?

Posted: Wed Apr 10, 2019 3:05 am
by hemeny23
This probably has a simple answer but I can't wrap my head around. I have watched a few of your tutorials and have created a selector that selects the rows on a site. But the tutorial then goes ahead and uses other selectors to select elements inside each row. In my case, I just want to extract from the row itself, so something like Select.Self. Does something like this exist?

I've tried selecting the row again but is not extracting anything:

Code: Select all

Select.Row
extract
   text
      Select.Row

Re: Select row itself?

Posted: Wed Apr 10, 2019 3:05 pm
by webmaster
Since the row is already selected, you don't need to select anything. If you just need the text, you can do this:

Code: Select all

Select.Row
extract
   text
      Gather.Text
The reason your current code is not extracting anything is because is trying to find a row inside a row itself and not finding it.

Re: Select row itself?

Posted: Fri Apr 19, 2019 6:49 pm
by hemeny23
Thanks that worked! Another probably related question. I'd like to, in addition to the row's text, extract some other text above each row into another column, but since the row is selected I'm not sure how to do this. Is there a way to select the row's parent element and then some other element inside?

Re: Select row itself?

Posted: Sun Apr 21, 2019 10:01 pm
by webmaster
You could use this premade, but it'd be easier to recreate you Select.Row selector to select the whole row (including the text above the row). To do this, first rename your Row selector as something else, then select this selector on the browser and press the Detect List button at the bottom. This should select the largest containers that contain the rows, so each selected element should include one row and the text above. With this elements selected, create a new selector and call it Select.Row.

After making these changes, your extract logic should look like this (assuming you renamed Row to InnerRow and you have a selector called TextAbove that selects the text above each row):

Code: Select all

Select.Row
extract
   text
      Select.InnerRow
   textAbove
      Select.TextAbove