Free/Batch Data Collector offers an assisted selection tool for Selectors. This option is particularly effective for identifying very complex and non-repetitive nodes scattered here and there throughout the source code.
Defining a Main or Recursive Block with Assisted Select can be a bit more complicated. This is largely because the recursive element does not only depend on the webpage’s source code, but also on the user’s intentions. From the user’s point of view, any element of the page could technically be recursive, whether they are URLs scattered throughout the code or lines of text in a table. So, if needed, the html tag used as the main block greatly simplifies things for us.
Let’s start with a concrete example.
Next to each text box for composing a Node is the Select key:
1. With the webpage to be analyzed opened under the Free / Batch Data Collector window, click on the Select button.
At the same time, two events will take place. First, Receive buttons will appear next to all the Select buttons:
On the underlying webpage to be used while writing your Recipe, Select keys will appear in the upper left-hand corner of select-able blocks, which are highlighted in red as you browse them via mouse-over:
2. Choose the section you want to use as your main block, which is usually the parent of all the blocks to be extracted.
3. The program will recommend, if found, two different types of Selectors: On the left an Absolute Selector, typically more suitable to act as a Main Block or Recursive Element, and on the right a Relative Selector, usually more useful when defining column Nodes (calculated from a previous selection of a Main Block).
4. Confirm the Selector you wish to use with the “Select this” key.
5. Back in the Free/Batch Data Collector window, click the Receive key next to the blank Selector you’d like to update with the imported code.
6. Repeat for each of the Recipe columns:
7. Set the data Type of each column (generally text) and proceed with your data extraction.
The Assisted Select tool is absolutely intended to be more intuitive than simply hand-writing complex Selectors, however non-conscious use of this feature could be quite frustrating. In fact, the on-screen rendering of a webpage does not always reflect the structure of the underlying code. This gets even worse if the website programmer has made errors when writing their HTML. The best way to avoid frustration while creating useful and powerful Recipes is with awareness, intention when connecting data between this instrument and the Chrome Inspect option, and a healthy dose of focus and attention.