Skip to content

Commit a202828

Browse files
committed
Updated readme!
1 parent 2a811dc commit a202828

File tree

4 files changed

+565
-35
lines changed

4 files changed

+565
-35
lines changed

README.md

Lines changed: 210 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
# Browser Automation Master
22

3-
A Domain Specific Language that compiles into valid python code!
3+
A Domain Specific Language (DSL) that compiles into valid python code!
4+
5+
---
46

57
### Supported Browsers
68

79
- **Brave**
810
- **Chrome**
911
- **Firefox**
1012

13+
---
14+
1115
### Supported Python Versions
1216

1317
- **3.9.x**
@@ -17,27 +21,34 @@ A Domain Specific Language that compiles into valid python code!
1721
- **3.13.x**
1822
- **3.14.x**
1923

24+
---
25+
2026
### Supported Operating Systems
2127

2228
- Linux **(x64)**
2329
- MacOS 11.0+ **(x64)**
24-
- Windows 10 **(ARM64, x64, x86)**
30+
- Windows 10 **(ARM64, x64, x86)**
2531
- Windows 11 **(ARM64, x64, x86)**
2632

33+
---
2734

2835
### Supported Platforms
2936

3037
- **x86**
3138
- **x64**
3239
- **ARM64**
3340

41+
---
42+
3443
### System Requirements (Minimum)
3544

3645
- 2+ Core CPU
3746
- 4GB DDR3 RAM (The application itself uses under 200MB of RAM)
3847
- Any Supported Browser
3948
- Any Supported Python Version
4049

50+
---
51+
4152
### Tested On
4253

4354
- AMD Athlon Gold 3150U
@@ -50,100 +61,264 @@ A Domain Specific Language that compiles into valid python code!
5061
- Intel I7 7700
5162
- Intel I5 8500
5263

64+
---
65+
5366
## BAMC Documentation
5467

5568
### Actions
5669

5770
The following actions can be used in your BAMC scripts:
5871

59-
6072
- `browser`: This MUST be the first valid line of the file. If not supplied, defaults to a Firefox instance or user agent (depending on the other defined features).
61-
- **Syntax:**
62-
- `browser "brave"`
63-
- `browser "chrome"`
64-
- `browser "firefox"`
65-
73+
- **Syntax:**
74+
- `browser "brave"`
75+
- `browser "chrome"`
76+
- `browser "firefox"`
6677
- `click`: Clicks the specified button element.
6778
- **Syntax:** `click "selector" \\ Supports ID, NAME, TAG NAME, and XPATH`
68-
6979
- `click-exp`: Alternative to `click`; use this if `click` is causing issues.
7080
- **Syntax:** `click-exp 'css-selector.item_element' \\ Supports CSS SELECTOR`
71-
72-
- `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)
81+
- `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)
7382
- **Syntax:** `end-javascript`
74-
7583
- `fill-text`: Assigns the specified value to the selected element.
7684
- **Syntax:** `fill-text "selector" "Value you want to include"`
77-
7885
- `get-text`: Gets the text for a specified element.
7986
- **Syntax:** `get-text "selector" \\ Supports ID, NAME, TAG NAME, and XPATH`
80-
8187
- `save-as-html`: Saves the current page's HTML to a file with the specified name.
8288
- **Syntax:** `save-as-html "filename.html"`
83-
8489
- `save-as-html-exp`: 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.
8590
- **Syntax:** `save-as-html-exp "filename.html"`
86-
8791
- `select-option`: Selects an `<option>` from a `<select>` dropdown menu. Currently only supports `<select><option></option></select>`.
8892
- **Syntax:** `select-option "selector" 2 // 2 is the option number so the 2nd item in the list would be selected.`
89-
9093
- `select-element`: Selects the element associated with the provided selector (if found).
9194
- **Syntax:** `select-element "selector" \\ This currently works but, theres no logic to access the selected element, this should only be done if youre manually editing the compiled python script.'`
92-
93-
- `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.,
95+
- `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.
9496
- **Syntax:** `start-javascript`
95-
9697
- `take-screenshot`: Takes a screenshot of the browser after executing the previous line.
9798
- **Syntax:** `take-screenshot "filename.png" \\ It's recommended to add a "wait-for-seconds" command before executing this.`
98-
9999
- `visit`: Visits a specified URL.
100100
- **Syntax:** `visit "https://url-to-visit.com/page.html"`
101-
102101
- `wait-for-seconds`: Waits for the specified number of seconds before continuing.
103-
- **Syntax:** `wait-for-seconds 1 \\ Also supports decimals, so .2 would be 1/5 of a second (200ms)`
104-
102+
- **Syntax:** `wait-for-seconds 1 \\ Also supports decimals, so .2 would be 1/5 of a second (200ms)`
103+
105104
### Arguments (CLI)
106105

107106
These arguments can be used when running BAMC from the command line:
108107

109108
- `add`: Adds a `.bamc` file to the `userScripts` directory.
110109
- **Syntax:** `bamm add 'path/to/filename.bamc'`
111-
112110
- `compile`: Compiles a `.bamc` file that isn't located in the `userScripts` directory.
113111
- **Syntax:** `bamm compile 'path/to/filename.bamc'`
114-
115112
- `delete`: Adds a local `.bamc` file to the `userScripts` directory.
116113
- **Syntax:** `bamm delete 'filename.bamc'`
117-
118114
- `help`: Adds a local `.bamc` file to the `userScripts` directory.
119115
- **Syntax:**
120116
- `bamm help --all` -> This displays information for all available commands.
121117
- `bamm help wait-for-seconds` -> This displays information about the selected command
122-
123118
- `--set-timeout`: Sets the default timeout in seconds for all Selenium-based browser actions.
124-
- **Syntax:** `bamm --set-timeout==5`
119+
- **Syntax:** `bamm --set-timeout==5`
125120

126121
### Features
127122

128123
These features can be enabled or configured in your BAMC scripts:
129124

130125
- `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.
131126
- **Syntax:** `feature "async" // Currently not supported, will throw an error if you use.`
132-
133127
- `bypass-cloudflare`: Instructs the browser to use a more advanced approach to bypass Cloudflare.
134128
- **Syntax:** `feature "bypass-cloudflare" // Currently not supported, will throw an error if you use.`
135-
136129
- `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.
137130
- **Syntax:** `feature "disable-pycache"`
138-
139131
- `use-http-proxy`: Uses the entered HTTP proxy for the session.
140132
- **Syntax:** `feature "use-http-proxy" "USER:PASS@IP:PORT"` -> Use `NULL:NULL@IP:PORT" if no user:pass authentication is required.
141-
142133
- `use-https-proxy`: Uses the entered HTTPS proxy for the session.
143134
- **Syntax:** `feature "use-https-proxy" "USER:PASS@IP:PORT"` -> Use `NULL:NULL@IP:PORT" if no user:pass authentication is required.
144-
145135
- `use-socks4-proxy`: Uses the entered SOCKS4 proxy for the session.
146136
- **Syntax:** `feature "use-socks4-proxy" "USER:PASS@IP:PORT"` -> Use `NULL:NULL@IP:PORT" if no user:pass authentication is required.
147-
148137
- `use-socks5-proxy`: Uses the entered SOCKS5 proxy for the session.
149138
- **Syntax:** `feature "use-socks5-proxy" "USER:PASS@IP:PORT"` -> Use `NULL:NULL@IP:PORT" if no user:pass authentication is required.
139+
140+
---
141+
142+
## Supported Selectors
143+
144+
### Basic
145+
146+
- **ID:** `#main-content`
147+
- **Class:** `.btn-primary`
148+
- **Type / Tag:** `div`
149+
- **Custom Element:** `my-custom-element`
150+
- **Name Attribute:** `[name="elementName"]` (Note this is NOT the same as Tag)
151+
- **XPath Selector:** `//form[@class='exampleClassName']//input[@type='text']`
152+
153+
### Advanced
154+
155+
- **Universal:** `*`
156+
- **Attribute (Presence):** `[href]`
157+
- **Attribute (Value):** `[target=_blank]`
158+
- **Attribute (Quoted Value):** `[title='A simple title']`
159+
- **Attribute (Complex Quoted Value):** `[data-value="some complex 'value' with quotes"]`
160+
- **Pseudo-class:** `:hover`
161+
- **Pseudo-class (with arguments):** `:nth-child(2n+1)`
162+
- **Pseudo-class (with complex arguments):** `:not(.visible, #main)`
163+
- **Pseudo-element:** `::before`
164+
165+
### Limitations
166+
167+
- For complex/nested selectors like `:not(div > .item)`, it will capture `div > .item` as a single string but will not parse further.
168+
- This handles attributes with quoted strings quite well, but it doesn't fully support **all** CSS escaping rules Example: `"id="foo.bar""` would require the selector `"#foo\.bar"`.
169+
- This is **not** full CSS/XPATH parsing and will not catch all invalid selectors, however most rules are currently supported.
170+
- The CSS parsing currently doesn't support the following characters: ">", "+", "~", " ", etc.
171+
172+
---
173+
174+
# Compile BrowserAutomationMaster (BAM) from Source
175+
176+
This guide provides instructions on how to compile BrowserAutomationMaster Manager (BAMM) from its source code for various operating systems.
177+
178+
## Prerequisites
179+
180+
Before you begin, ensure you have the following installed on your system:
181+
182+
1. **.NET 8.x SDK:** The most recent 8.x SDK as of writing this, is 8.0.17. [Download Link](https://dotnet.microsoft.com/en-us/download/dotnet/8.0).
183+
2. **Git (Optional but Recommended):** For cloning the repo, you can also use the source code provided with each release.
184+
185+
## General Compilation Steps
186+
187+
1. **Download and Extract the Source Code:**
188+
189+
- Go to the latest release page: `https://github.com/Static-Codes/BrowserAutomationMaster/releases/latest/`
190+
- Download the `source.zip` file.
191+
- Extract/Unzip the source.
192+
193+
2. **Navigate to the Source Directory:**
194+
195+
```bash
196+
cd BrowserAutomationMaster
197+
```
198+
199+
3. **Restore .NET Dependencies:**
200+
This step is usually handled automatically by the build/publish commands, but it's good practice to run it manually if you encounter issues:
201+
```bash
202+
dotnet restore
203+
```
204+
205+
## Platform-Specific Compilation Instructions
206+
207+
Choose the instructions relevant to your target operating system. All commands should be run from within the `BrowserAutomationMaster` source directory.
208+
209+
## Linux
210+
211+
### .deb Package Compilation (for Debian/Ubuntu-based systems)
212+
213+
This will create a `.deb` package for easy installation.
214+
215+
1. **Install `dotnet-deb` tool (if not already installed):**
216+
217+
```bash
218+
dotnet tool install --global dotnet-deb
219+
# Ensure the .dotnet/tools directory is in your PATH
220+
# export PATH="$PATH:$HOME/.dotnet/tools" (add to your .bashrc or .zshrc for permanency)
221+
```
222+
223+
2. **Compile and Package:**
224+
```bash
225+
dotnet deb --runtime linux-x64 --configuration Release
226+
```
227+
The resulting `.deb` package will typically be found in the project's root directory or a sub-directory like `bin/Release/`. Check the command output for the exact location.
228+
229+
#### Generic Linux Publish (Self-Contained Application)
230+
231+
If you don't want a `.deb` package or are on a non-Debian-based Linux distribution, you can create a self-contained application.
232+
233+
1. **Publish for Linux x64:**
234+
```bash
235+
dotnet publish -c Release -r linux-x64 --self-contained true
236+
```
237+
The compiled application will be in `bin/Release/netX.Y/linux-x64/publish/` (where `X.Y` is the .NET version, e.g., `net8.0`).
238+
239+
### macOS
240+
241+
This will create a self-contained application for macOS 11.0+ (Both Intel and Apple Silicon via Rosetta 2).
242+
243+
1. **Publish for macOS x64:**
244+
245+
```bash
246+
dotnet publish -c Release -r osx-x64 --self-contained true
247+
```
248+
249+
The compiled application will be in `bin/Release/netX.Y/osx-x64/publish/`.
250+
251+
2. **(Optional) Publish for macOS ARM64 (Apple Silicon):**
252+
This is for Apple Silicon users **ONLY**:
253+
```bash
254+
dotnet publish -c Release -r osx-arm64 --self-contained true
255+
```
256+
The compiled application will be in `bin/Release/netX.Y/osx-arm64/publish/`.
257+
258+
### Windows
259+
260+
This will create self-contained applications for different Windows architectures.
261+
262+
1. **Publish for Windows x64 (64-bit):**
263+
264+
```bash
265+
dotnet publish -c Release -r win-x64 --self-contained true
266+
```
267+
268+
The compiled application will be in `bin\Release\netX.Y\win-x64\publish\`.
269+
270+
2. **Publish for Windows ARM64:**
271+
272+
```bash
273+
dotnet publish -c Release -r win-arm64 --self-contained true
274+
```
275+
276+
The compiled application will be in `bin\Release\netX.Y\win-arm64\publish\`.
277+
278+
3. **Publish for Windows x86 (32-bit):**
279+
280+
```bash
281+
dotnet publish -c Release -r win-x86 --self-contained true
282+
```
283+
284+
The compiled application will be in `bin\Release\netX.Y\win-x86\publish\`.
285+
286+
4. **Download [Inno Setup v6.4.3](https://jrsoftware.org/download.php/is.exe?site=1)**
287+
Ensure "Associate Inno Setup with the .iss file extension" is checked during setup.
288+
289+
5. **Create an installer**
290+
Navigate to `BrowserAutomationMaster\src\Installer Files\Windows`
291+
Right click on the .iss file corresponding to your published build (ARM64, x64, x86)
292+
Click compile
293+
294+
The installer will be in `BrowserAutomationMaster\src\Published Builds\{Your architecture}\`
295+
296+
## Installation
297+
298+
- **Linux `.deb` package**
299+
You can install the package by double clicking the .deb file, or by using:
300+
```bash
301+
sudo dpkg -i <package_name>.deb
302+
# If there are dependency issues, fix them with:
303+
sudo apt-get install -f
304+
```
305+
- **MacOS**
306+
The compiled application will be in `bin/Release/netX.Y/osx-arm64/publish/`.
307+
Place it on your Desktop for easy access!
308+
use chmod +x Desktop/bamm to make it an executable!
309+
- **Windows**
310+
Simply double click the installer in `BrowserAutomationMaster\src\Published Builds\{Your architecture}\`
311+
312+
## Opening BAMM
313+
314+
- **MacOS**
315+
Desktop/bamm
316+
317+
- **Linux and Windows**
318+
bamm
319+
320+
## Troubleshooting
321+
322+
- **.NET SDK Not Found:** Ensure the .NET SDK is installed correctly and that the `dotnet` command is available in your system's PATH.
323+
- **Permission Issues:** On Linux/macOS, you might need to use `sudo` for global tool installation or for installing `.deb` packages. For compilation itself, `sudo` is generally not required or recommended.
324+
- **Incorrect Runtime Identifier:** Ensure you're using a valid runtime identifier (RID) for your target platform. You can find a list of RIDs [here](https://docs.microsoft.com/en-us/dotnet/core/rid-catalog).
File renamed without changes.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Browser Automation Master - Full Documentation
2+
3+
### Table of Contents
4+
5+
- [**1. Project Overview**](#browser-automation-master)
6+
- [1.1. Supported Browsers](#supported-browsers)
7+
- [1.2. Supported Python Versions](#supported-python-versions)
8+
- [1.3. Supported Operating Systems](#supported-operating-systems)
9+
- [1.4. Supported Platforms](#supported-platforms)
10+
- [1.5. System Requirements](#system-requirements-minimum)
11+
- [1.6. Tested Hardware](#tested-on)
12+
- [**2. BAMC Language Reference**](#bamc-documentation)
13+
- [2.1. Actions](#actions)
14+
- [2.2. CLI Arguments](#arguments-cli)
15+
- [2.3. Features](#features)
16+
- [**3. Supported Selectors**](#supported-selectors)
17+
- [3.1. Basic Selectors](#basic)
18+
- [3.2. Advanced Selectors](#advanced)
19+
- [3.3. Limitations](#limitations)
20+
- [**4. Compiling from Source**](#compile-browserautomationmaster-bam-from-source)
21+
- [4.1. Prerequisites](#prerequisites)
22+
- [4.2. General Compilation Steps](#general-compilation-steps)
23+
- [4.3. Platform-Specific Compilation](#platform-specific-compilation-instructions)
24+
- [Linux](#linux)
25+
- [macOS](#macos)
26+
- [Windows](#windows)
27+
- [4.4. Installation](#installation)
28+
- [4.5. Running BAMM](#opening-bamm)
29+
- [4.6. Troubleshooting](#troubleshooting)
30+
31+
---

0 commit comments

Comments
 (0)