BAMC Advanced Documentation
This document provides a detailed breakdown of the argument types for each action and feature in the BAMC Language.
Actions
-
Argument 1 (Header Name):
string
(e.g., "DNT") -
Argument 2 (Header Value):
string
(e.g., "1")
-
Argument 1 (Headers):
JSON Object
(Key-value pairs where keys are header names (string) and values are header values (string))
-
Argument 1 (Browser Type):
string
("chrome" or "firefox")
-
Argument 1 (Selector):
string
(A valid ID, NAME, TAG NAME, or XPATH selector for the element to click)
-
Argument 1 (X Coordinate):
string
(The X coordinate position on screen, e.g., "600") -
Argument 2 (Y Coordinate):
string
(The Y coordinate position on screen, e.g., "600")
click; use this if
click is causing issues. Supports CSS SELECTOR.
-
Argument 1 (CSS Selector):
string
(A valid CSS selector for the element to click)
end-javascript is
not found within the file (when a start-javascript is
present).
-
Argument 1 (Selector):
string
(A valid selector for the input element) -
Argument 2 (Value):
string
(The text value to assign to the element)
fill-text.
-
Argument 1 (Selector):
string
(A valid selector for the input element) -
Argument 2 (Value):
string
(The text value to assign to the element)
-
Argument 1 (Selector):
string
(A valid ID, NAME, TAG NAME, or XPATH selector for the element)
-
Argument 1 (URL):
string
(The URL to visit in the new tab, e.g., "https://google.com") -
Argument 2 (Wait Time):
string
(The number of seconds to wait before visiting the URL, e.g., "3")
-
Argument 1 (File Name):
string
(The path and name of the HTML file to save, e.g., "output.html")
save-as-html doesn't fit your needs.
-
Argument 1 (File Name):
string
(The path and name of the HTML file to save)
<option> from a
<select> dropdown menu. Currently only supports
<select><option></option></select>.
-
Argument 1 (Selector):
string
(A valid selector for the<select>element) -
Argument 2 (Option Number):
integer
(The 0-based or 1-based index of the option to select, depending on implementation details; 2 typically means the 3rd item if 0-based, or 2nd if 1-based. Clarification needed for specific implementation.)
-
Argument 1 (Selector):
string
(A valid selector for the element)
bamm --set-custom-useragent, which sets this
value at startup.
-
Argument 1 (User Agent String):
string
(The full user agent string to set)
end-javascript is found; Will throw an
error if end-javascript is not found within the file.
-
Argument 1 (File Name):
string
(The path and name of the PNG file to save, e.g., "screenshot.png")
-
Argument 1 (URL):
string
(A valid URL string, including protocol like "https://")
-
Argument 1 (Seconds):
number
(The duration to wait, can be an integer or a floating-point number, e.g., 1 or 0.2)
| Command | Syntax Example | Description | Argument Types |
|---|---|---|---|
add-header |
add-header "DNT" "1" |
Adds an HTTP Header for the current request. |
|
add-headers |
add-headers {"header-name1": "header-value1", ...}
|
Adds multiple HTTP Headers for the current request via a JSON Object. |
|
browser |
browser "chrome" |
Specifies the browser type. This MUST be the first valid line of the file. If not supplied, defaults to a Firefox instance or user agent. |
|
click |
click "selector" |
Clicks the specified button element. Supports ID, NAME, TAG NAME, and XPATH selectors. |
|
click-at-position |
click-at-position "600" "600" |
Clicks at a specific point on screen. |
|
click-exp |
click-exp 'css-selector.item_element' |
Alternative to click; use this if
click is causing issues. Supports CSS SELECTOR.
|
|
close-current-tab |
close-current-tab |
Closes the current tab and will close the browser if there's only one open tab. |
|
end-javascript |
end-javascript |
Instructs the parser that the end of a JavaScript code block
was reached. An error will be thrown if
end-javascript is not found within the file (when
a start-javascript is present).
|
|
fill-text |
fill-text "selector" "Value you want to include"
|
Assigns the specified value to the selected element. |
|
fill-text-exp |
fill-text-exp "selector" "Value you want to include"
|
More advanced version of fill-text.
|
|
get-text |
get-text "selector" |
Gets the text for a specified element. Supports ID, NAME, TAG NAME, and XPATH selectors. |
|
open-new-tab |
open-new-tab "https://google.com" "3" |
A new browser tab is opened, the system will then pause for the number of seconds specified, then visits the requested url. |
|
save-as-html |
save-as-html "filename.html" |
Saves the current page's HTML to a file with the specified name. |
|
save-as-html-exp |
save-as-html-exp "filename.html" |
Saves the current page's HTML to a file with the specified
name but uses different logic; use this if
save-as-html doesn't fit your needs.
|
|
select-option |
select-option "selector" 2 |
Selects an <option> from a
<select> dropdown menu. Currently only
supports
<select><option></option></select>.
|
|
select-element |
select-element "selector" |
Selects the element associated with the provided selector (if found). This currently works but, there's no logic to access the selected element; this should only be done if you're manually editing the compiled Python script. |
|
set-custom-useragent |
set-custom-useragent "Mozilla/5.0 (...)" |
Sets a custom user agent at the current point in the script,
unlike bamm --set-custom-useragent, which sets
this value at startup.
|
|
start-javascript |
start-javascript |
Instructs the parser to read all following lines as a .js code
block, until end-javascript is found; Will throw
an error if end-javascript is not found within
the file.
|
|
take-screenshot |
take-screenshot "filename.png" |
Takes a screenshot of the browser after executing the previous line. It's recommended to add a "wait-for-seconds" command before executing this. |
|
visit |
visit "https://url-to-visit.com/page.html" |
Visits a specified URL. |
|
wait-for-seconds |
wait-for-seconds 1 |
Waits for the specified number of seconds before continuing. Supports decimals. |
|
Features
-
Argument 1 (Extension path):
string
Supported formats:"https://chromewebstore.google.com/detail/extension-name/manifest-id"
"https://addons.mozilla.org/en-US/firefox/addon/extension-name"
"https://addons.mozilla.org/firefox/downloads/file/extension-id/extension-name.xpi"
"file://path/to/firefox/extension.xpi"
"file://path/to/chrome/extension.crx"
__pycache__ directory. This directory is written by
Visual Studio Code and contains .pyc files.
-
Argument 1 (Proxy String):
string
(Format: "USER:PASS@IP:PORT". Use "NULL:NULL@IP:PORT" for no authentication.)
-
Argument 1 (Proxy String):
string
(Format: "USER:PASS@IP:PORT". Use "NULL:NULL@IP:PORT" for no authentication.)
feature "use-socks4-proxy" "NULL:NULL@IP:PORT" if no
user:pass authentication is required.
-
Argument 1 (Proxy String):
string
(Format: "USER:PASS@IP:PORT". Use "NULL:NULL@IP:PORT" for no authentication.)
feature "use-socks5-proxy" "NULL:NULL@IP:PORT" if no
user:pass authentication is required.
-
Argument 1 (Proxy String):
string
(Format: "USER:PASS@IP:PORT". Use "NULL:NULL@IP:PORT" for no authentication.)
| Command | Syntax Example | Description | Argument Types |
|---|---|---|---|
add-extension |
feature "add-extension" "path/to/extension"
|
Downloads the extension, validates it's contents, then install it as an add-on to the current Selenium extension. |
|
disable-pycache |
feature "disable-pycache" |
Instructs the compiler to disable the writing of the
__pycache__ directory. This directory is written
by Visual Studio Code and contains .pyc files.
|
No arguments for the feature declaration itself. |
disable-ssl |
feature "disable-ssl" |
Disables SSL certificate authentication for the given session. | No arguments for the feature declaration itself. |
use-http-proxy |
feature "use-http-proxy" "USER:PASS@IP:PORT"
|
Uses the entered HTTP proxy for the session. Use "NULL:NULL@IP:PORT" if no user:pass authentication is required. |
|
use-https-proxy |
feature "use-https-proxy" "USER:PASS@IP:PORT"
|
Uses the entered HTTPS proxy for the session. Use "NULL:NULL@IP:PORT" if no user:pass authentication is required. |
|
use-socks4-proxy |
feature "use-socks4-proxy" "USER:PASS@IP:PORT"
|
Uses the entered SOCKS4 proxy for the session. Use
feature "use-socks4-proxy" "NULL:NULL@IP:PORT" if
no user:pass authentication is required.
|
|
use-socks5-proxy |
feature "use-socks5-proxy" "USER:PASS@IP:PORT"
|
Uses the entered SOCKS5 proxy for the session. Use
feature "use-socks5-proxy" "NULL:NULL@IP:PORT" if
no user:pass authentication is required.
|
|
CLI Arguments
.bamc file to the
userScripts directory.
-
Argument 1 (Filename)
string
(e.g., "path/to/filename.bamc")
BAMM-Backup.zip.
.bamc file that isn't located in the
userScripts directory
-
Argument 1 (Filename)
string
(e.g., "path/to/filename.bamc")
-
Argument 1 (Feature name):
string
(The specified feature you want to learn more about.)
-
Argument 1 (Filename):
string
(The name of the file you wish to create)
-
Argument 1 (Filename):
string
(The name of the file you wish to open or create)
$DISPLAY variable, use
this to check if your system supports BAMM's GUI.
-
Argument 1 (User Agent String):
string
(The full user agent string to set)
click; use this if
click is causing issues. Supports CSS SELECTOR.
-
Argument 1 (Timeout):
integer
(A valid integer greater than 0)
| Command | Syntax Example | Description | Argument Types |
|---|---|---|---|
add |
add 'filename.bamc' |
Adds a .bamc file to the
userScripts directory.
|
|
backup |
bamm backup |
Backs up all application files to
BAMM-Backup.zip.
|
|
compile |
bamm compile 'path/to/filename.bamc' |
Compiles a .bamc file that isn't located in the
userScripts directory
|
|
help |
bamm help "feature-name" |
Displays information about the specified command. |
|
new |
bamm new "filename.bamc"
|
Creates a new .BAMC file in the userScripts directory. Prompts the user to select a custom text editor to open the specified file. If a custom text editor is not found, the OS default is used. |
|
open |
bamm open "filename.bamc"
|
Opens a .BAMC file that exists in the userScripts directory. If this file does not exist, the file is automatically created. The user is then prompted to select a custom text editor to open the specified file. If a custom text editor is not found, the OS default is used. |
|
restore |
bamm restore |
Looks for a backup of BAMM's data, if the data is found, a restoration is attempted. |
|
--bs |
bamm --bs |
Instructs BAMM to use BrowserStack to run the compiled scripts, works on all platforms except ChromeOS, as chromebooks are too underpowered to run selenium. |
|
--editbsconf |
bamm --editbsconf |
Edit and Overwrite Browserstack's YAML Config via an interactive process. (For advanced users) |
|
--force-error |
bamm --force-error |
Forces a verbose error message, which is helpful for making a bug report. |
|
--gui |
bamm --gui |
Starts the Graphical User Interface for BAMM. |
|
--nohwc |
bamm --nohwc |
Instructs BAMM not to check your system's hardware for compatibility, this should not be done unless you've already verified BAMM can run on your machine. |
|
--platform-debug |
bamm --platform-debug |
Displays information on the operating system and machine currently running BAMM. |
|
--query-display |
bamm --query-display |
Displays the status of the $DISPLAY variable, use
this to check if your system supports BAMM's GUI.
|
|
--set-custom-useragent |
bamm --set-custom-useragent=="Mozilla/5.0 (...)"
|
Sets the user agent that the browser uses on start up. |
|
--set-timeout |
bamm --set-timeout==5 |
Alternative to click; use this if
click is causing issues. Supports CSS SELECTOR.
|
|
--version |
bamm --version |
Displays the current version of BAMM, and whether there's a new version available. |
|
Selectors
id attribute.
"myElementId" (for
<div id="myElementId">)
name attribute, commonly
used for form elements.
"username" (for
<input name="username">)
"button" (for all
<button> elements)
"//div[@class='container']/p[2]"
"div.product-item > h3.title"
| Selector Type | Description | Example |
|---|---|---|
| ID Selector |
Selects an element by its unique id attribute.
|
"myElementId" (for
<div id="myElementId">)
|
| NAME Selector |
Selects an element by its name attribute,
commonly used for form elements.
|
"username" (for
<input name="username">)
|
| TAG NAME Selector | Selects all elements with a specific HTML tag name. |
"button" (for all
<button> elements)
|
| XPATH Selector | Selects elements using an XML Path Language (XPath) expression, allowing for complex selections. | "//div[@class='container']/p[2]" |
| CSS Selector | Selects elements using Cascading Style Sheets (CSS) selectors, offering a flexible way to target elements based on their attributes, classes, IDs, and relationships. | "div.product-item > h3.title" |
Using SelectorGadget
Installation
Step 1: Install the Extension
Chrome Only: Chrome Web Store - SelectorGadget
Step 2: Pin to Toolbar (Optional)
Once installed, you can pin the SelectorGadget extension to your browser's toolbar for easier access. Look for the extension icon and click the pin button.
How to Use SelectorGadget
Step 1: Activate SelectorGadget
Navigate to the web page you want to inspect and click on the SelectorGadget icon in your browser's toolbar. A yellow bar will appear at the bottom of the page indicating that SelectorGadget is active.
Step 2: Select Your Target Element
Click on the element you want to select. The element will be highlighted in green, and SelectorGadget will suggest a CSS selector for it in the bottom bar.
Step 3: Refine Your Selection
If other unwanted elements are also highlighted in green, click on them to exclude them. They will turn red, indicating they're excluded from the selection.
Continue clicking elements to include (green) or exclude (red) until only your desired elements are selected.
Step 4: Copy the Selector
Once you're satisfied with the selection, copy the CSS selector from the yellow bar at the bottom of the page. This is the selector you'll use in your BAMC commands.
Alternative Methods for Finding Selectors
Using Browser Developer Tools
Step 1: Right-click on the element you want to select
Step 2: Choose "Inspect" or "Inspect Element" from the context menu
Step 3: In the developer tools, right-click on the highlighted HTML element
Step 4: Choose "Copy" → "Copy selector" or "Copy XPath"
name or id attribute first. These are
often the most reliable selectors to use and are simpler than
complex CSS selectors.
Selector Best Practices
- Prefer ID selectors when available - they're unique and fast
- Use name attributes for form elements like inputs and buttons
- Avoid overly complex selectors that might break if the page structure changes
-
Test your selectors in the browser console using
document.querySelector("your-selector") - Consider using XPath for complex selections that CSS can't handle easily
Common Selector Examples
ID Selector:
"submit-button" (targets
<button id="submit-button">)
Name Selector: "email" (targets
<input name="email">)
Class Selector:
".btn-primary" (targets elements with
class="btn-primary")
Tag Selector: "button" (targets all
button elements)
XPath:
"//button[contains(text(), 'Submit')]" (targets
button containing "Submit" text)
Example BAMC Script
browser "chrome" feature "disable-ssl" visit "https://example.com" wait-for-seconds 2 fill-text "username" "myemail@example.com" fill-text "password" "mypassword" click "login-button" wait-for-seconds 3 take-screenshot "logged-in.png" save-as-html "page-content.html"
visit, wait-for-seconds, and
take-screenshot to get familiar with the syntax.
Configuration Tutorial
📁 File Locations
%appdata%/BrowserAutomationMaster/config/config.ini
/Users/your-username/Library/Application
Support/BrowserAutomationMaster/config/config.ini
$HOME/.config/BrowserAutomationMaster/config/config.ini
⚙️ Configuration Properties
[compilation]
Automatically copy the project directory after a successful compilation.
Automatically run the project after a successful compilation.
[interface]
Theme used for the application on Windows and MacOS. Linux automatically sets theme based on terminal background color.
[messaging]
Runs a check on the CPU to determine its number of cores and feature set. Disabling this is only recommended once you've determined your CPU is supported.
Runs a check on the RAM to determine total and free system memory. Disabling this is only recommended once you've determined you have adequate RAM.
Checks if your BAMM version is latest and prompts to update if not. Disabling this is not recommended unless causing major instability.
[overrides] Advanced Users Only
⚠️ Special Section: The override section is not included by default. This section is ONLY meant for users experienced with HEX, RGB, or XTERM color formats.
Format:
@Override PropertyName = PropertyValue
Accepted PropertyNames:
- ForegroundColor
- SuccessColor
- WarningColor
- ErrorColor
- HighlightBackground
- HighlightForeground
- AccentColor
PropertyValue Examples:
RGB Format:
RGB(255, 255, 255)
White
RGB(0, 0, 0)
Black
RGB(175, 220, 237)
Coral Blue
HEX Format:
#FFFFFF
White
#000000
Black
#AFDCED
Coral Blue
XTERM Format:
FFFF/FFFF/FFFF
White
0000/0000/0000
Black
5F5F/FFFF/D7D7
Gold