Skip to content
stefanautomateedPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Noro.rs Form Automation Tool

Automated form filling tool for noro.rs using Playwright. This tool generates random Serbian names, addresses, and phone numbers to fill out forms multiple times per day.

Features

  • 🤖 Automated form filling with Playwright
  • 🇷🇸 Random Serbian data generation (names, addresses, phone numbers)
  • ⏰ Scheduled runs at configurable times
  • 🌐 Web dashboard for manual control and monitoring
  • 📝 Comprehensive logging
  • 🎭 Stealth mode to avoid detection
  • 📸 Screenshot capture for debugging
  • 📊 Real-time statistics and status tracking

Prerequisites

  • Python 3.8 or higher
  • pip (Python package manager)

Installation

  1. Clone the repository (if not already done):

    git clone <repository-url>
    cd prevara
  2. Create a virtual environment (recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Install Playwright browsers:

    playwright install chromium
  5. Configure environment variables:

    cp .env.example .env
    # Edit .env with your preferred settings

Configuration

Edit the .env file to configure the tool:

# Schedule times (24-hour format, comma-separated)
SCHEDULE_TIMES=10:00,14:00,18:00

# Target website
TARGET_URL=https://noro.rs/

# Browser settings
HEADLESS=false  # Set to true to run without visible browser

# Delays between actions (seconds)
MIN_DELAY=1
MAX_DELAY=3

# Web interface settings
PORT=5000
AUTO_START_SCHEDULER=true
SECRET_KEY=change-this-to-a-random-secret-key

Usage

Web Interface (Recommended for Railway/Cloud Deployment)

The tool now includes a web dashboard for easy control and monitoring!

Start the web server:

python app.py

Then open your browser to http://localhost:5000

Features:

  • ▶️ Manual trigger button to run form submissions on-demand
  • ⏰ Start/Stop scheduler from the web interface
  • 📊 Real-time statistics (total runs, success rate, etc.)
  • 📋 Live log viewer
  • ⚙️ Configuration display

Environment Variables for Web Interface:

PORT=5000                    # Web server port
AUTO_START_SCHEDULER=true    # Auto-start scheduler on app launch
SECRET_KEY=your-secret-key   # Flask secret key (change in production)

CLI Mode

Test Mode (Run Once)

Run the form filler once with a visible browser to test and debug:

python main.py --test

Run once in headless mode:

python main.py --test --headless

Run Once Immediately

Run once with the settings from .env:

python main.py --now

Scheduled Mode

Run the form filler on the schedule defined in .env:

python main.py --schedule

Or simply:

python main.py

The scheduler will run continuously and execute form fills at the specified times.

Custom URL

Override the target URL from command line:

python main.py --test --url "https://example.com"

Project Structure

prevara/
├── app.py                       # Flask web application (WEB INTERFACE)
├── main.py                      # CLI entry point
├── form_filler.py              # Core form filling logic
├── scheduler.py                 # Scheduling functionality
├── serbian_data_generator.py   # Random Serbian data generation
├── templates/                   # Web interface templates
│   └── index.html              # Dashboard HTML
├── requirements.txt             # Python dependencies
├── Dockerfile                   # Docker configuration for Railway/cloud deployment
├── railway.toml                 # Railway-specific configuration
├── .dockerignore                # Files to exclude from Docker build
├── .env                         # Configuration (create from .env.example)
├── .env.example                 # Example configuration
├── .gitignore                   # Git ignore rules
├── setup.sh                     # Automated setup script
├── logs/                        # Log files and screenshots (auto-created)
└── README.md                    # This file

Generated Data

The tool generates realistic Serbian data:

Names

  • Common Serbian first names (male/female)
  • Common Serbian last names
  • Example: "Marko Jovanović", "Ana Petrović"

Phone Numbers

  • Starts with 063, 064, or 069
  • Format: 06X/XXXXXXX or 06XXXXXXXXX
  • Example: "0631234567"

Addresses

  • Common Serbian street names
  • Random street numbers
  • Serbian cities
  • Postal codes
  • Example: "Kralja Petra 45, Beograd, 11000"

Emails

Important Notes

Form Submission Safety

By default, the actual form SUBMISSION is DISABLED in form_filler.py for safety.

To enable actual form submission:

  1. Open form_filler.py
  2. Find the section with # UNCOMMENT TO ACTUALLY SUBMIT THE FORM
  3. Uncomment the submit button click code
  4. Test thoroughly before running on schedule

Customizing Form Selectors

The current form selectors are generic placeholders. You need to:

  1. Run in test mode: python main.py --test
  2. Inspect the website's actual form fields
  3. Update the selectors in form_filler.py to match the real form
  4. Look for the selector lists in the fill_form() method

Example fields to customize:

  • name_selectors
  • phone_selectors
  • email_selectors
  • address_selectors
  • city_selectors
  • postal_selectors
  • submit_selectors

Debugging

  • Check logs/ directory for:
    • form_filler.log - Form filling logs
    • scheduler.log - Scheduler logs
    • main.log - Main application logs
    • Screenshots (taken before/after form submission and on errors)

Running in Background

Linux/Mac (using screen or tmux)

# Using screen
screen -S form-filler
python main.py --schedule
# Press Ctrl+A then D to detach

# To reattach
screen -r form-filler
# Using tmux
tmux new -s form-filler
python main.py --schedule
# Press Ctrl+B then D to detach

# To reattach
tmux attach -t form-filler

As a systemd service (Linux)

Create /etc/systemd/system/form-filler.service:

[Unit]
Description=Form Filler Service
After=network.target

[Service]
Type=simple
User=youruser
WorkingDirectory=/path/to/prevara
ExecStart=/path/to/prevara/venv/bin/python main.py --schedule
Restart=always

[Install]
WantedBy=multi-user.target

Then:

sudo systemctl enable form-filler
sudo systemctl start form-filler
sudo systemctl status form-filler

Deployment

Deploy to Railway

Railway is a platform that makes it easy to deploy and host this tool in the cloud.

Cost: Expect $10-20/month depending on usage (Railway bills based on resource usage)

Steps:

  1. Create a Railway account at railway.app

  2. Install Railway CLI (optional):

    npm install -g @railway/cli
  3. Deploy via Railway Dashboard:

    • Click "New Project"
    • Select "Deploy from GitHub repo"
    • Choose your repository
    • Railway will auto-detect the Dockerfile
  4. Set Environment Variables in Railway dashboard:

    SCHEDULE_TIMES=10:00,14:00,18:00
    TARGET_URL=https://noro.rs/
    HEADLESS=true
    MIN_DELAY=1
    MAX_DELAY=3
    AUTO_START_SCHEDULER=true
    SECRET_KEY=your-random-secret-key-here
    
  5. Deploy:

    • Railway will automatically build and deploy
    • The web interface will be available at your Railway URL
    • Access the dashboard to manually trigger runs or monitor automation

Important Railway Notes:

  • HEADLESS must be true on Railway (no GUI available)
  • Browser automation uses significant resources (RAM/CPU)
  • Access the web dashboard at your Railway app URL to control the automation
  • Check Railway logs: railway logs or via dashboard
  • Monitor costs in Railway dashboard
  • The web interface provides full control: manual triggers, start/stop scheduler, view logs
  • Screenshots won't work in Railway (no display), but logs will

Railway CLI Deployment:

# Login
railway login

# Link to project or create new
railway link

# Deploy
railway up

# View logs
railway logs

Other Hosting Options

For more affordable hosting, consider:

  • VPS (DigitalOcean, Linode): $5-12/month
  • Oracle Cloud Free Tier: FREE forever (ARM VMs)
  • Render: $7/month for background workers
  • Home server/Raspberry Pi: One-time cost

See the "Hosting Options" section in our documentation for detailed comparisons.

Troubleshooting

Playwright timeout errors

  • Increase timeout values in form_filler.py
  • Check your internet connection
  • Ensure the website is accessible

Form fields not found

  • Run in test mode with visible browser
  • Inspect the actual HTML elements on the website
  • Update selectors in form_filler.py
  • Check screenshots in logs/ directory

Browser not launching

  • Run playwright install chromium again
  • Check system dependencies: playwright install-deps chromium

403 Forbidden errors

  • The website may have anti-bot protection
  • Try running in non-headless mode
  • Increase delays between actions
  • Consider adding more human-like behavior

Development

Testing the data generator

python serbian_data_generator.py

Adding new features

  1. Test locally with --test mode first
  2. Check logs in logs/ directory
  3. Review screenshots for debugging
  4. Update this README with new features

License

This tool is for educational and testing purposes only. Use responsibly and in accordance with the target website's terms of service.

Security

  • Never commit .env file to version control
  • Keep logs directory out of version control
  • Review screenshots before sharing as they may contain sensitive data

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages