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.
bot.print_pdf()
// Printing the current page.
printPdf();
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()
print(filepath)
// 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")
print(number_files)
// Getting the number of PDF files in the current working directory.
int numberFiles = getFileCount(getDownloadPath(), ".pdf");
System.out.println(numberFiles)
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.
bot.install_firefox_extension(extension=extension_path)
// Setting the extension path.
String extensionPath = "<path to the .xpi file>";
// Adding the extension.
installFirefoxExtension(extensionPath);
Tip
Firefox extensions can be downloaded on the Firefox Add-ons website.