Simple robot

This robot is included in our downloadable example robots. You can also find the code at the example robots repository.

This simple robot opens a web page, stores some text content, and takes a screenshot of an image element on the web page.

Run this robot locally in Robocorp Lab

You can run this robot on your local machine using Robocorp Lab:

  1. Set up your development environment.
  2. Download the example robots.
  3. Open the simple-web-scraper example.
  4. Open the tasks.robot file and run it.

Robot script

*** Settings ***
Documentation     An example robot. Opens a web page and stores some content.
...               The web page text is stored in the "output" directory.
...               An image screenshot is embedded in the log.
Library           OperatingSystem
Library           RPA.Browser

*** Variables ***
${URL}            https://robotframework.org/

*** Tasks ***
Store Web Page Content
    Open Available Browser    ${URL}
    ${text}=    Get Text    scroller
    Create File    ${CURDIR}${/}output${/}text.txt    ${text}
    Capture Element Screenshot    css:.img-fluid
    [Teardown]    Close Browser