Getting Started Main Features Examples

【Flowchart Mode】Introduction to the function points of the "Loop" component

2018-10-15 19:27:02
202 views

Abstract:This tutorial introduces the function points of the loop component.

In the “What is a Flow Component” tutorial, we introduced various flow components in the ScrapeStorm Flowchart Mode. Considering the complexity of the “loop” component function, we will describe its function points in more detail in this article.

The “Loop component” consists of a Loop Condition subcomponent and a nested behavior component, as shown in the following figure:

The loop conditions are set as follows:

Next, we will explain in detail the meaning of these conditions and how to use them.

1. Text List

Using Text List as a loop condition means that text is sequentially input in a web page, and is switched once per cycle.Generally used to collect content corresponding to different keywords in the same website.

The loop condition of the Text List generally needs to be used with the “Enter Text” component, and the “Input Text” setting item of the “Enter Text” component is set to “Use the text in the current loop”.

2. URL List

Using URL List as a loop condition means that the URLs are entered one after the other in the web page, and are switched once per cycle. Generally used to collect content from multiple URLs.

The loop condition of the URL list generally needs to be used with the “Open URL” component, and the “URL” setting item of the “Open URL” component is set to “Use the URL in the current loop”.

3. Element List

Using Element List as a loop condition means collecting all the same list elements in the web page, and its settings include “XPath of the list elements”.

We can generate an XPath by clicking the button to the right of the settings box and then clicking on the list element in the page.

4. Single Element

Using Single Element as a loop condition means looping through the paged elements in the page, such as the next page or loading more buttons. Its settings include the “XPath of the single element” and “Cycles”.

We can generate an XPath by clicking the button to the right of the settings box and then clicking on the list element in the web page.”Cycles” generally corresponds to the number of pages we need to scrape.

The looping condition of Single Element is generally used in conjunction with the “Click Element” component, and “XPath of the element” setting item  of the “Click Element” component is set to “Use the XPath of the element in the current loop”.

5. Select List

Using Select List as a loop condition means selecting each option of the drop-down list in the web page in turn. Its settings include “XPath of the Select List”. We can generate an XPath by clicking the button to the right of the settings box and then clicking on the list element in the page.

The looping condition of Select List is generally used in conjunction with the “Select dropList” component and the setting item of the “Select dropList” component is set to “Use the Select List in the current loop”.