Actions right arrow Actions List right arrow Execute JavaScript right arrow Class List right arrow GlobalObject

Contains methods and objects accessible throughout the whole project.


Functions

void CustomExport ( string templateName , string fileName , bool overwrite )

Runs a custom export template and saves the result to a file. A custom export template must exist before calling this function.

Parameters:
templateName The template name.
fileName The output file name. The file will be created under the Exports folder inside the output folder, which can be set at Options -> Output Folder.
overwrite Determines whether the file must be overwritten if it already exists or a new name should be generated.
string Download ( string url , string extension , string subFolder )

Attempts to download the file at the specified URL to the folder given by combining [Downloads Folder]\[Project Name]\[subFolder].
This function blocks the UI thread, and the application might freeze while downloading a large file.

Parameters:
url The URL to download the file from.
extension An extension to be added or replaced after downloading the file. If null, the source's extension will be kept.
subFolder The folder under [Downloads Folder]\[Project Name] in which to save the file. If null, the file will be saved at [Downloads Folder]\[Project Name].
Returns:
The saved file name.
object Gather ( string gathererName , object element )

Gets the element's property gathered by the specified property gatherer. The specified gatherer must be one of the Extraction Gatherers.

Parameters:
gathererName The property gatherer to use.
element The element from which the specified property gatherer will get the property.
Returns:
The gathered property.
ExtractionInfoObject GetExtractionInfo ( object element , string tableName )

Gets an ExtractionInfoObject which contains information about changes made to the given table associated with the specified element.

Parameters:
element The element from which to get its ExtractionInfoObject.
tableName The table to which the returned ExtractionInfoObject will refer to.
Returns:
An ExtractionInfoObject object.
string GetVar ( string name )

Returns the value of the specified variable.

Parameters:
name The name of the variable.
Returns:
The value of the specified variable as a string.
void Log ( string text )

Writes the given text to the log.

Parameters:
text The line to add to the log.
void Pause ( )

Pauses the execution after the JavaScript code returns.

void RotateProxy ( )

Rotates the proxy after the JavaScript code returns.

int SaveToVirtualTree ( object element )

Saves the given element to the Virtual Tree and returns the Id assigned to the node that represents it in the Virtual Tree. This node can be later on used with the SetCurrentParent function. The node will exist for as long as the current parent exists. The current parent exists while the children nodes of this Execute JavaScript's parent node are being executed.

Parameters:
element The element to save to the virtual tree.
Returns:
The Id that identifies the saved element in the Virtual Tree.
void SetExtractionInfo ( object element , string tableName , object id , string action )

Saves a new ExtractionInfoObject into the Virtual Tree, which emulates the specified element being extracted to the row identified by the given id, in the specified tableName. For a list of possible action values, see ExtractionInfoObject.

Parameters:
element The element to which associate the ExtractionInfoObject.
tableName The table to which the given element will be associated.
id The id that represents the row associated with the given element.
action The action that was performed in the database with the given element.
void SetVar ( string name , string value )

Assigns the given value to the specified variable.

Parameters:
name The name of the variable.
value The value to assign to the variable.
void Stop ( )

Stops the execution after the JavaScript code returns.

void Wait ( int milliseconds )

Instructs Helium Scraper to suspend the execution for the specified time after the JavaScript code returns.

Parameters:
milliseconds The number of milliseconds for which the execution will be suspended.

Properties

readonly BrowserObject Browser

Gets a BrowserObject that represents the main browser.

readonly DataBaseObject DataBase

Gets a DataBaseObject that represents the database.

string LastError

If the last action performed by the GlobalObject object caused an error, this object gets a description of it. Otherwise it gets an empty string.

readonly ProcessObject Process

Gets a ProcessObject that contains methods and properties to interact with other instances of Helium Scraper.

readonly UtilsObject Utils

Gets a UtilsObject that contains miscellaneous utilities.

object UserData

Can be used to store information accessible throughout the whole project.