How To Use DOM Parser Package in Robomotion

How To Use DOM Parser Package in Robomotion?

How to Use DOM Parser Package in Robomotion RPA

In this guide, we will walk you through a practical example demonstrating how to use the DOM Parser package within Robomotion RPA. By the end of this guide, you’ll have a clear understanding of how to utilize this powerful package to enhance communication workflows and boost productivity in your team.

How To Use DOM Parser Package in Robomotion?
How To Use DOM Parser Package in Robomotion

Getting Started with DOM Parser in Robomotion

Step 1: Login to Your Workspace
To begin, log in to your Robomotion workspace. If you’re new to Robomotion, you can easily create your workspace by signing up via the registration link provided on the platform. Make sure the “DOM Parser” package is installed before proceeding with your workflow.

What is the DOM Parser Package?

The DOM Parser package allows you to parse XML or HTML code into a DOM Document, enabling automated workflows to interact with structured data more effectively. This package includes several useful nodes such as:

  • Find Element
  • Find All Elements
  • Get Value
  • Extract Text

These nodes empower you to extract and interact with elements from a webpage or XML document in a structured, systematic manner.

How to Install the DOM Parser Package

Step 1: Go to your workspace and click the cube icon to navigate to the packages page.

Step 2: In the search field, type “DOM Parser” and install the package by right-clicking on it.

Building the Workflow with DOM Parser Nodes

Once the package is installed, you can start building your workflow. The basic structure includes the following key steps:

  1. Inject Node: This node initializes the flow and sets it in motion.
  2. Config Function Node: This function node defines the core variables required for the workflow using JavaScript code. Below is an example of the code block used in the “Config” function node. Config Function Code Block:
   msg.link = "https://docs.robomotion.io/tutorials/"; // The URL to parse
   msg.css_selector = "[class='theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item']"; // The CSS Selector for the page section to extract
   msg.tag = "a"; // The tag of the HTML element you're targeting

   return msg;

This JavaScript block tells the bot which webpage to visit, which CSS selector to target, and which HTML tag to focus on.

Running the Flow

After configuring your workflow, running it will provide the parsed data in the “Output” section. For instance, in this example, the workflow extracts and lists the categories available on the specified page.

Conclusion

By leveraging the DOM Parser package in Robomotion RPA, you can efficiently parse and extract elements from webpages or XML documents to automate complex workflows. This package simplifies the interaction with HTML or XML content, making it a valuable tool for improving communication and operational efficiency within your team.

Also Read – How to Install Robomotion

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *