Design Studio User's Guide
Extraction is concerned with "getting the right content." Extraction mainly includes selecting, copying,
and normalizing content from a web page that you have navigated to. When extracting in Design Studio,
you typically use the Test Tag action to skip uninteresting ("noisy") content, the Extract action to copy
content into variables, and the data converters for normalizing the content so that it gets the format you
want, e.g. the right date and number format. Once extracted, you output the value with the "Store in
Database" or "Return Value" action.
So, the typical robot starts with one or more steps, each containing a Load Page or Click action, in order
navigate to the interesting content on some web site. It proceeds with one or more steps, each containing
an Extract action, and ends with a step storing or returning the extracted value.
Note that in many robots the navigation and extraction parts overlap because the content to extract is
located on several pages. Again, this is similar to when you look for content yourself; often, you have to
visit several pages to get the content you want.
Most robots include other actions than the ones mentioned above, e.g. a For Each Tag action for loading
several similar looking pages or extracting values from several similar looking table rows. Because robots
have different tasks, they have different needs. For this reason, we have included a considerable number
of step actions and data converters in Design Studio. Start with familiarizing yourself with the basic and
most commonly used step actions and data converters, and then begin to explore. Experience shows that
one can create most robots using only a handful of step actions and data converters. So, find your own
favorite step actions and data converters and stick to them until you feel a need to explore others.
How to Write Well-Structured Robots
A robot is a program so writing well-structured robots is important for the same reasons as it is for writing
programs in other programming languages. Writing unstructured robots is like writing books with no
chapters and no table of contents. So writing well-structured robots is important because:
• it helps document the robots
• it makes it easier to maintain the robots
• it makes it easier to find your way around the robots
A side-effect of writing well-structured robots is that it often also makes robots load faster in Design Studio
and generally be more responsive when edited, e.g. when updating the Robot View.
The two main 'tools' that you have at your disposal to write well-structured robots are: Snippet steps and
Group steps. Both these two types of steps are used as a way to take a part of a robot, give it a descriptive
name and let you pack it up in a single step. In this way you can forget what the part of the robot does in
detail and concentrate on other issues of you robot. This is very similar to other concepts found in other
programming languages, e.g. methods, function, procedures, etc.
You use a group step to pack up and hide steps that performs a well-defined task that you can give a
descriptive name, e.g. Login to site X, Report error. It is important that you can give a relatively short
descriptive name to the group step that describes what the steps inside the group does. If you can't then it
is probably because they do not perform a well-defined task. Introducing a group step you help document
your robot, because the name describes what that part of the robot does.
Although snippet is mainly introduced to share functionality between robots they can also be used inside a
single robot to help structure this. If you have a collection of steps in robot that is used in several branches,
e.g. by having edges from different part of the robot joining at the start of the steps, you can replace this
kind of sharing of steps by introducing a snippet containing the steps.
Let us look at a simple example of one way one may structure a robot using snippets and groups instead
of joining edges. Assume that our robot that looks like this: