baseSelector

Use this option to indicate the root element from which the other selectors will be evaluated.

It is useful to display search results as it ensures that each result is aligned on its base.

Let’s say yo need to extract the titles and prices from a list of search results in which not all the results have a price. Without defining a base selector, the function will not be able to link the title to the right price. Instead it will output a list of titles in one column and a list of prices in a second column but the price next to the title might not correspond.

By setting a base selector, the function will leave a blank cell when there is no price, ensuring that titles and prices always correspond.

Here is in a example:

In that case, we’ve selected the baseSelector so the function understands that it should align the ratings relatively to their corresponding titles and urls