Objective
The objective of this How-To guide is to program OpenBots Studio to open a web browser window (Google Chrome®), navigate to a website, extract website information (page title, html information, etc.) and enter it into an Excel Workbook. This example can be applied in many different scenarios.
Walkthrough
The following guide demonstrates the commands to complete the objective above.
Step 1: To create an instance of a Web Browser, there is only one command needed, called Selenium Create Browser Command. This instance will be associated with the new browser window throughout the entire process.
  • Select Selenium Create Browser Command
  • Type the name of the Web Browser Instance (ex. ChromeBrowser)
  • Select the browser to use under Engine Type (i.e. Chrome)
  • Under URL, type the website to navigate to (for this example, navigate to the Google homepage first). The Selenium Navigate to URL Command can also be used to navigate to a website.
  • Set Window State to Maximize (default)
  • Type in a Selenium command if desired (skip this step for now)
  • Set the Command to Private if desired (optional but not necessary)
  • Add any comments if desired
  • Click Ok
Step 2: To navigate to a specific website, the Selenium Navigate to URL command is used.
  • Select Selenium Navigate to URL Command
  • Set the Browser Instance name to the same as step 1 (ex. ChromeBrowser)
  • Type the website URL
  • Click OK
Step 3: To extract the website information (e.x. Web Page Title), the Get Browser Info Command can be used. This command can only obtain a limited amount of info, however.
  • Select Selenium Get Browser Info Command
  • Set the Browser Instance name to the same as step 1 (ex. ChromeBrowser)
  • Type the property to extract (in this case Window Title)
  • Type the variable name to send this data to (vTitle). The variable can be created here by typing in the name or an already existing variable can be used here.
  • Click OK
Step 4: To open a new or already existing Excel Workbook, the Create Excel Application command is used. (Refer to the Excel command guides to learn more.)
  • Select Create Excel Application Command
  • Set the Excel Instance name to a new OBAppInstance variable called “ExcelInstance”
  • Select whether to create a new workbook or open an existing one (this guide will create a new workbook)
  • Set Visible status to “No” (default). Select yes if the user wishes to see the application open. If not, the application will run in the background.
  • For “Close all Existing Excel Instances”, select ‘Yes’ (default)
  • Click Ok
Step 5: To write text in the workbook, use the Write Cell Command. This will be necessary to use the next command: Append Cell.
  • Select Write Cell Command
  • Set the Excel Instance name to “ExcelInstance”
  • Type the value which OpenBots will write into the workbook. In this example, the guide used the variable vColumn which held the following word: “Title”
  • Select which cell to write this value
  • Click Ok
Step 6: To append a cell to the workbook with the website information, use the Append Cell Command. The Append Cell command will only work if the document already contains information.
  • Select Append Cell Command
  • Set the Excel Instance name to “ExcelInstance”
  • Type the name of the variable used in step 3 (e.g. vTitle)
  • Click OK
Step 7: To save the new workbook, use the Save Workbook As Command
  • Select Save Workbook As Command
  • Set the Excel Instance name to “ExcelInstance”
  • Under ‘Workbook Location’, select where to save this file. In this example, the workbook was saved in the same folder as this automation file (ProjectPath)
  • Write the name of this new workbook (e.g. Web Browser Exercise)
  • Click OK
Step 8: To close the edited Excel Workbook, there is only one command needed, called Close Excel Application Command
  • Select Close Excel Application Command
  • Set the Excel Instance name to “ExcelInstance”
  • Set Save Workbook to “Yes” (optional and not necessary in this example)
  • Click OK
Step 9: To close the web browser instance, use the Selenium Close Browser command. This marks the end of the process.
  • Select Selenium Close Browser Command
  • Set the Browser Instance name to “ChromeBrowser”
  • Click OK
When the automation is ran, the end result is the following: The Chrome Browser and the Excel Workbook should be closed. In the automation project file, the newly created workbook will be saved (Web Browser Exercise.xlsx):
When the user opens the file, the word “Title” will be in cell A1 as directed and the Yahoo Finance® will be in cell below (A2):
The command in this guide can be utilized alongside many of the other commands that will be discussed in later guides. Below is a snapshot of the commands in this guide
Commands utilized for the above concept (Access Website Information) are as follows:

Web Browser and Excel Command(s): Selenium Create Browser, Selenium Navigate to URL, Selenium Get Browser Info, Create Excel Application, Write Cell, Append Cell, Close Excel Application, Selenium Close Browser

Newsletter Bot

Lets stay in touch!

Join our weekly newsletter and follow us on social media.

Contact Sales
Call Our Experts!