A Node.js-based browser automation solution using Puppeteer with Jornaya detection evasion, proxy rotation, and geo-based lead matching.
- Jornaya Detection Evasion: Uses Puppeteer with stealth plugins to avoid bot detection
- Proxy Rotation: Works with FoxyProxy extension for automatic IP rotation every 300 seconds
- Geo-based Lead Matching: Detects current IP location and matches with leads from database
- Human-like Behavior: Implements realistic typing delays, mouse movements, and form interactions
- Time Management: Ensures form completion within 200 seconds before proxy rotation
- Database Integration: PostgreSQL integration for lead management
- Node.js 16+
- PostgreSQL database
- Google Chrome browser
- FoxyProxy extension (for proxy rotation)
-
Clone the repository
git clone <repository-url> cd human-agent
-
Install dependencies
npm install
-
Set up environment variables
cp env.example .env # Edit .env with your configuration -
Set up database
CREATE TABLE leads ( id SERIAL PRIMARY KEY, first_name VARCHAR(100) NOT NULL, last_name VARCHAR(100) NOT NULL, email VARCHAR(255) NOT NULL, phone VARCHAR(20) NOT NULL, address TEXT NOT NULL, city VARCHAR(100) NOT NULL, state VARCHAR(50) NOT NULL, zip_code VARCHAR(10) NOT NULL, used BOOLEAN DEFAULT FALSE, used_at TIMESTAMP, created_at TIMESTAMP DEFAULT NOW() );
# Database Configuration
DB_HOST=localhost
DB_PORT=5432
DB_NAME=leads_db
DB_USER=your_username
DB_PASSWORD=your_password
# Browser Configuration
HEADLESS=false
CHROME_PATH=/usr/bin/google-chrome
# Target Website
TARGET_URL=https://example.com/form
# Proxy Configuration
PROXY_ENABLED=true
FOXY_PROXY_PATH=/path/to/foxy-proxy-extension
# Logging
LOG_LEVEL=infoUpdate the form selectors in config.js to match your target website:
formSelectors: {
firstName: 'input[name="firstName"]',
lastName: 'input[name="lastName"]',
email: 'input[name="email"]',
phone: 'input[name="phone"]',
address: 'input[name="address"]',
city: 'input[name="city"]',
state: 'select[name="state"]',
zipCode: 'input[name="zipCode"]',
submitButton: 'button[type="submit"]'
}npm start -- --testnpm startnpm run dev- IP Detection: The system detects the current IP address and geolocation
- Lead Matching: Finds unused leads from the database matching the current IP's state/region
- Browser Initialization: Launches Chrome with stealth settings to avoid detection
- Form Filling: Fills the form with human-like behavior (typing delays, mouse movements)
- Submission: Submits the form and marks the lead as used
- Scheduling: Runs every 250 seconds to complete before the 300-second proxy rotation
- Main automation logic with Puppeteer
- Human-like behavior simulation
- Jornaya detection evasion
- Form filling and submission
- IP geolocation detection
- Database lead matching
- Lead management (mark as used)
- Orchestrates the automation cycles
- Handles scheduling and timing
- Graceful shutdown management
- Stealth Plugin: Uses puppeteer-extra-plugin-stealth
- User Agent Rotation: Random realistic user agents
- Human-like Delays: Random typing and movement delays
- Realistic Headers: Proper HTTP headers
- Viewport Management: Realistic browser viewport
- Mouse Movements: Curved mouse movement paths
The system is designed to work with FoxyProxy extension:
- Form filling completes within 200 seconds
- Proxy rotation occurs every 300 seconds
- 50-second buffer ensures completion before IP change
CREATE TABLE leads (
id SERIAL PRIMARY KEY,
first_name VARCHAR(100) NOT NULL,
last_name VARCHAR(100) NOT NULL,
email VARCHAR(255) NOT NULL,
phone VARCHAR(20) NOT NULL,
address TEXT NOT NULL,
city VARCHAR(100) NOT NULL,
state VARCHAR(50) NOT NULL,
zip_code VARCHAR(10) NOT NULL,
used BOOLEAN DEFAULT FALSE,
used_at TIMESTAMP,
created_at TIMESTAMP DEFAULT NOW()
);- Chrome not found: Set
CHROME_PATHin .env - Database connection: Check database credentials and connection
- Form selectors: Update selectors in config.js to match your target site
- Proxy issues: Ensure FoxyProxy is properly configured
Check the console output for detailed logs. The system logs:
- IP detection results
- Lead matching information
- Form filling progress
- Error details
- Store sensitive data in environment variables
- Use secure database connections
- Implement rate limiting if needed
- Monitor for detection and adjust behavior accordingly
MIT License