Stu Mason
Stu Mason

Activity

Pull Request Merged

PR #6 merged: Add scraper infrastructure with proxy rotation support

Summary

  • Adds production-grade scraping infrastructure with anti-detection features
  • Integrates Webshare.io for residential proxy rotation (datacenter + residential)
  • Provides artisan command for testing proxy health against targets

What's included

ScraperClient

HTTP client with stealth features:

  • Rotating user agents (desktop/mobile browser fingerprints)
  • Realistic browser headers (sec-ch-ua, referer, etc.)
  • Cookie jar management
  • Configurable request delays

Proxy System

  • ProxyRotator: Manages proxy pools with health checking
  • WebshareProvider: Webshare.io integration with rotating/sticky sessions
  • Country targeting (e.g., UK, US residential IPs)

Configuration

  • config/scraper.php: Centralized config for strategies, proxies, rate limits

Testing

  • php artisan scraper:test-proxies - Test proxy health and effectiveness

Usage

use App\Services\Scraper\ScraperClient;
use App\Services\Scraper\Proxy\WebshareProvider;

$provider = new WebshareProvider(config('scraper.proxy.webshare.token'));
$proxy = $provider->getRotatingProxy('GB');  // UK residential

$client = new ScraperClient();
$response = $client
    ->withProxy($proxy)
    ->getJson('https://example.com/api');

Test plan

  • Test datacenter proxies against httpbin.org
  • Test residential proxies against Reddit JSON API
  • Verify proxy rotation (different IPs each request)
  • Verify country targeting works
  • Review for security best practices
  • Review for code standards compliance
+1093
additions
-0
deletions
6
files changed