This document provides a detailed breakdown of the argument types for each action and feature in the BAMC Language.
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-exp |
click-exp 'css-selector.item_element' |
Alternative to click ; use this if click is
causing issues. Supports CSS SELECTOR.
|
|
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).
|
No arguments. |
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. |
|
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 for the current script. |
|
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.
|
No arguments. |
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. |
|
Command | Syntax Example | Description | Argument Types |
---|---|---|---|
async |
feature "async" |
This indicates to the compiler you want to create an asynchronous script. This should not be done unless you have experience using async functions in Python. Currently not supported, will throw an error if you use. | No arguments for the feature declaration itself. |
bypass-cloudflare |
feature "bypass-cloudflare" |
Instructs the browser to use a more advanced approach to bypass Cloudflare. Currently not supported, will throw an error if you use. | No arguments for the feature declaration itself. |
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. |
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.
|
|
For a tutorial on how to find selectors, please click here
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" |
SelectorGadget is a browser extension that makes it easy to find the
correct CSS selector for any element on a web page. This is incredibly
useful when you need to interact with specific elements using commands
like click-exp
or fill-text-exp
.
Follow these steps to find a CSS selector using SelectorGadget:
document.querySelectorAll('your-selector-here')
to see
which elements it selects.
This CSS selector can now be used in your BAMC script with commands that
support CSS selectors, such as click-exp
or
fill-text-exp
.