Advanced Guide

Master Browser Automation

Complete guide to automating Nox Core with Puppeteer, Playwright, and Selenium. Production-ready code examples and best practices.

Quick Start

Get running in 5 minutes

Code Examples

Copy-paste ready snippets

RPA Engine

No-code automation

Code Examples

Puppeteer + Chrome DevTools Protocol

Connect to Nox Core via Chrome DevTools Protocol for full browser control.

Basic Setup
// 1. Launch Nox Core with remote debugging
// Add flag: --remote-debugging-port=9222

const puppeteer = require('puppeteer-core');

const browser = await puppeteer.connect({
  browserWSEndpoint: 'ws://localhost:9222',
  defaultViewport: null
});

const page = await browser.newPage();
await page.goto('https://example.com');
Advanced Features
// Advanced profile management
const profileId = 'your-profile-id';

// Get all available targets
const targets = await browser.targets();
const pageTarget = targets.find(t => t.type() === 'page');

// Execute CDP commands
const client = await page.target().createCDPSession();

// Set custom user agent
await client.send('Network.setUserAgentOverride', {
  userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'
});

// Block specific resources
await client.send('Network.setBlockedURLs', {
  urls: ['*.analytics.com', '*.tracking.js']
});
Automation Patterns
// Automation best practices
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));

// Human-like typing
async function humanType(page, selector, text) {
  for (const char of text) {
    await page.type(selector, char, { delay: Math.random() * 100 + 50 });
  }
}

// Random mouse movements
async function randomMove(page) {
  await page.mouse.move(
    Math.random() * 800 + 100,
    Math.random() * 600 + 100
  );
}

// Use in your script
await randomMove(page);
await humanType(page, '#username', 'john_doe');
await delay(Math.random() * 500 + 200);
await humanType(page, '#password', 'secret123');

Best Practices

Avoid Detection

  • Use realistic delays between actions (200-1000ms)
  • Randomize mouse movements and click positions
  • Vary viewport sizes and user agents
  • Clear cookies and storage between sessions

Performance

  • Reuse browser instances when possible
  • Use headless mode for better performance
  • Block unnecessary resources
  • Implement connection pooling

Proxy Management

  • Rotate proxies every 10-20 requests
  • Match proxy location with profile timezone
  • Test proxy quality before use
  • Use residential/ISP proxies for sensitive sites

Error Handling

  • Implement retry logic with exponential backoff
  • Take screenshots on failure
  • Log all actions for debugging
  • Handle CAPTCHAs gracefully

RPA Engine Examples

Login Automation

Automate login flows with 2FA support

// Nox Core RPA - Login Flow
{
  "steps": [
    { "action": "navigate", "url": "https://example.com/login" },
    { "action": "wait", "selector": "#username", "timeout": 5000 },
    { "action": "type", "selector": "#username", "value": "{{USERNAME}}" },
    { "action": "type", "selector": "#password", "value": "{{PASSWORD}}" },
    { "action": "click", "selector": "#login-btn" },
    { "action": "wait", "selector": ".dashboard", "timeout": 10000 },
    { "action": "extract", "selector": ".user-name", "variable": "loggedUser" }
  ]
}

Data Extraction

Extract data from multiple pages

// Nox Core RPA - Data Extraction
{
  "steps": [
    { "action": "navigate", "url": "{{PRODUCT_URL}}" },
    { "action": "wait", "selector": ".product-title" },
    { "action": "extract", "selector": ".product-title", "variable": "title" },
    { "action": "extract", "selector": ".price", "variable": "price" },
    { "action": "extract", "selector": ".availability", "variable": "stock" },
    { "action": "screenshot", "name": "product_{{timestamp}}" },
    { "action": "webhook", "url": "{{API_ENDPOINT}}", "data": ["title", "price", "stock"] }
  ]
}

Form Submission

Automate complex form submissions

// Nox Core RPA - Form Submission
{
  "steps": [
    { "action": "navigate", "url": "https://example.com/form" },
    { "action": "select", "selector": "#country", "value": "{{COUNTRY}}" },
    { "action": "type", "selector": "#fullname", "value": "{{FULLNAME}}" },
    { "action": "type", "selector": "#email", "value": "{{EMAIL}}" },
    { "action": "click", "selector": "#terms-checkbox" },
    { "action": "click", "selector": "#submit-btn" },
    { "action": "wait", "selector": ".success-message", "timeout": 15000 },
    { "action": "condition", "if": ".error", "then": [{ "action": "log", "message": "Submission failed" }] }
  ]
}

Important Notice

Always respect website Terms of Service when automating. Use automation responsibly and ensure compliance with local laws and regulations.

Additional Resources

Ready to Automate?

Get your Nox Core license and start building powerful automation workflows today.

Get Started