Web Browser - Extract Source

Declaration

<AMBROWSER ACTIVITY="exsource" SESSION="text" RESULTVARIABLE="text (variable name)" />

See Also

Web Browser - Browser State, Web Browser - Close, Web Browser - Extract Table, Web Browser - Get Value, Web Browser - Set Value

Description

Extracts an HTML source and places the result in a variable.

IMPORTANT: AutoMate supports Internet Explorer automation out-of-the-box; Firefox automation requires a separate extension, which can be downloaded from here. Additionally, the browser you specify must be installed on the target system to ensure that these activities function properly.

Practical Usage

Retrieves an HTML document previously opened using the Web Browser - Open activity and populates a variable with the results. The HTML document can then be called in subsequent steps by specifying the variable name.

Parameters

Browser Properties

Property

Type

Required

Default

Markup

Description

Session Name

Text

Yes

BrowserSession1

SESSION="mySession"

Specifies the name of an existing session to associate with this activity. Numerous sessions can exist within a single task allowing activities to be performed on several web browsers simultaneously. If working with only one browser, this can remain at the default session name, which is BrowserSession1.

NOTE: Sessions are supported in Internet Explorer and Firefox browsers only.

Store HTML source in

Text

Yes

(Empty)

RESULTVARIABLE="myVar"

The name of an existing variable in which to populate the  HTML source with.

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab properties allows you to instruct a task step to react only to specific errors or ignore certain errors that should cause it to fail.

More on Error Causes properties

On Error Properties

The On Error tab properties lets you determine what the task should do if a particular step encounters an error as defined in the Error Causes properties.

More about On Error properties

Additional Notes

Expressions, Variables and Functions

All text fields allow the use of expressions such as variables, functions or AutoMate extended functions, which can be entered by surrounding the expression in percentage signs (example: %FileDateTime(myVar)% or %myVar%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by clicking the Insert Expression (%) button or by pressing F2.

More on expressions

More on variables

More on function

More on extended functions
More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

 

Description: Extract source of document to variable named "theVar"

 

<AMBROWSER ACTIVITY="exsource" SESSION="BrowserSession2" RESULTVARIABLE="theVar" />

 

↑ Top of Page