Skip to content

Miscellaneous Functions

Using these methods it is possible to use some very useful features in the development of automations such as:

Printing a page as a PDF file

This method prints the current page as a PDF file.

# Printing the current page.
// Printing the current page.

Getting the last created file

With the method get last created file you will get path of the most recent file saved in a given directory or current working directory.

# Retrieving the last created file in the current directory.
filepath = bot.get_last_created_file()

// Not yet implemented.

Getting the file count

Using the get file count you will be able to find the number of files of a given extension.

# Getting the number of PDF files in the current working directory.
number_files = bot.get_file_count(file_extension=".pdf")

// Getting the number of PDF files in the current working directory.
int numberFiles = getFileCount(getDownloadPath(), ".pdf");


Installing Firefox Extension

This method install an extension in the Firefox browser via the path of the .xpi extension to be loaded.

# Setting the extension path.
extension_path = "<path to the .xpi file>"

 # Adding the extension.
// Setting the extension path.
String extensionPath = "<path to the .xpi file>";

// Adding the extension.


Firefox extensions can be downloaded on the Firefox Add-ons website.