This project automates the resolution of CAPTCHAs on web pages using Playwright for browser automation and the Groq API for audio transcription. The idea is to simulate a flow where, after entering a tracking code, the system downloads the CAPTCHA audio, transcribes its content, and automatically inserts it into the form to proceed with the search.
- Python 3.x
- Playwright (async): For browser automation.
- aiofiles: Asynchronous file handling.
- Groq API: For audio transcription (Speech-to-Text).
- AsyncIO: For executing the program flow asynchronously.
- Python 3.x installed.
- Project dependencies installed (refer to the
requirements.txtfile if available, or install them manually):playwrightaiofilesgroq(or the corresponding SDK)
- Install Playwright browsers (e.g.,
playwright install). - Configure constants and environment variables (such as
GROQ_API_KEY) in theapp/constants.pyfile.
-
Clone the repository:
git clone git@github.com:your_username/YourRepository.git cd YourRepository -
Create a virtual environment (optional, but recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install the dependencies:
pip install -r requirements.txt
-
Install the Playwright browsers:
playwright install
-
Configure your variables and constants:
In theapp/constants.pyfile, define the URLs, tracking codes, and other parameters needed for automation, such as the selectors for page elements. -
Run the main script:
python main.py
The script will:
- Open the browser in non-headless mode.
- Navigate to the configured URL.
- Fill in the tracking code field.
- Download the CAPTCHA audio, transcribe it, and fill in the CAPTCHA field.
- Click the submit button and end the process.
.
├── app
│ ├── constants.py
│ ├── __init__.py
│ ├── logger_config.py
│ ├── logs
│ ├── main.py
│ ├── scrapping
│ │ ├── __init__.py
│ │ └── scrapper.py
│ └── utils
│ ├── __init__.py
│ └── path_utils.py
├── pyproject.toml
├── README.md
├── structure.txt
└── uv.lock
Work In Progress:
I am planning to evolve this project into an API that will return order updates. Future improvements will include API endpoints to enable real-time tracking and retrieval of order status information.
Contributions are welcome! I am actively considering improvements, so feel free to open an issue or submit a pull request.
This project is licensed under the MIT License.
