Auto-Detect Option
Last updated
Last updated
This option auto-detects how many elements there are in the list for a given lead selector.
This option is usually used in order to save public data where you cannot foresee how many results there are per page.
Leave untoggled if you know how many elements there are on the page. It is more reliable to provide a definite number of repetitions as opposed to using dynamic auto-detection. For example, if you scrape a list of profiles and you know there are ten profiles per page, then do not toggle auto-detection, simply enter 10 in the number of repetitions field below.
Presently, auto-scrolling is not supported for the auto-detect option. If you need auto-scrolling (for example, because your data is displayed in an endless scroll), then do not toggle auto-detect and enter number of repetitions below. If you do not know how many elements there are, simply enter an unrealistically high number, as the TaskBot will terminate the loop automatically if the selector repeatedly fails.
Lead selector (CSS or XPath) will be used to identify how many items there are in the list. It has to correspond to the selector of list items but should NOT (!) contain any nth-child or {loop_index} syntax.
(If you are unsure what nth-child or {loop_index} are, see .)
For example, the selector for the list item is defined like this:
When copied from the website: div[aria-label='Search results'] div[role='article']:nth-child(1) a[role='presentation']
When adjusted for loop index: div[aria-label='Search results'] div[role='article']:nth-child({loop_index,1}) a[role='presentation']
To define the lead selector, you now need to remove both the incremental element (and, if you added it, loop index, too) like this:
When adjusting original selector that was copied from the website: div[aria-label='Search results'] div[role='article']:nth-child(1) a[role='presentation']
When adjusting original selector that was copied from the website: div[aria-label='Search results'] div[role='article']:nth-child({loop_index,1}) a[role='presentation']
This is the final lead selector:
div[aria-label='Search results'] div[role='article'] a[role='presentation']
To check whether the lead selector is correct, do a browser check: Check if Selector Is Correct and Unique.