BetInAsia CSV Auto-Betting Script

Job ID: 40054600

Budget: $10 – $30 USD

TECHNICAL SPECIFICATION – Automated Betting System (BetInAsia Black) Integrated with CSV

1. Objective
Develop an automation system capable of:
1. Reading a continuously updated CSV file.
2. Identifying new unprocessed rows.
3. Logging into BetInAsia Black using credentials provided by the client.
4. Opening the correct event page.
5. Locating the exact market and selection.
6. Validating odds and stake.
7. Placing the bet.
8. Writing the result (success or error) back to the same CSV or to a log file.

The system must operate reliably without requiring any change to the existing CSV format.

2. Data Input (CSV)
The automation will receive a CSV file with fixed columns. Each row represents a bet to be placed.

Requirements:
- Skip rows that were already processed.
- Validate mandatory fields.
- Accept CSV from a monitored folder or via webhook.
- The CSV structure must remain unchanged.

3. Automation Workflow

3.1 Reading the File
- Load the latest CSV version.
- Detect new rows not previously processed.
- Each row triggers a single bet attempt.

3.2 Login
Automation must:
- Navigate to https://black.betinasia.com
- Insert username and password.
- Maintain valid session.
- Automatically re-login if needed.
- Use Python + Playwright or Selenium.

3.3 Navigating to the Event
- Open the event directly if a URL is provided.
- Otherwise, search by team names and enter the correct event.
- Handle name variations using fuzzy matching.

3.4 Selecting the Market
The automation must locate the exact market and selection as shown in the CSV.
Use intelligent DOM searching and fallback mechanisms.

3.5 Pre-Bet Validation
Before placing the bet:
- Confirm the selection exists.
- Confirm market compatibility.
- Verify odds have not changed beyond a configurable tolerance.
- Validate stake.
If any issue occurs, log the error and continue.

3.6 Executing the Bet
- Enter stake.
- Confirm the bet.
- Capture Bet ID.
- Verify successful placement.

3.7 Recording the Result
Write to output:
- status
- bet_id
- message
- processing_timestamp

4. Technical Requirements
Language:
- Python with Playwright (preferred) or Selenium.

Architecture:
- Script or modular project.
- Must run on Windows.
- No CSV format change.

Robustness:
- Timeout handling
- DOM error handling
- Retry with exponential backoff
- Clear logging
- Continue after failures

5. Security
- No hardcoded credentials.
- Use .env or environment variables.

6. Deliverables
Freelancer must deliver:
- Fully functional code
- README
- Demonstration video
- Clean and commented code

7. Unacceptable Solutions
- Screen-coordinate RPA
- Fragile scripts
- Hardcoded credentials
- Missing logs or error handling

8. Final Goal
A reliable automation that:
- Reads CSV continuously
- Logs into BetInAsia Black
- Finds event and market
- Places bet
- Logs result
- Runs without supervision