Skip to content

Playwright Integration


Playwright is a webscraping framework for Node.JS developed by Microsoft, which provides a high-level API to control Chromium, Firefox and Webkit over the DevTools Protocol.

Step 1: Install the library

npm install playwright

If required, install the browser binaries:

npx playwright install

Step 2: Retrieve project token


  1. Open Scrapoxy User interface, and go to the project Settings;
  2. Enable Keep the same proxy with cookie injection;
  3. Remember the project token (format is USERNAME:PASSWORD).

Step 3: Create and run the script

Create a file name playwright.js with the following content:

import playwright from 'playwright';

(async () => {
    const browser = await playwright.chromium.launch({
        ignore_default_args: ["--headless"],
        args: ["--headless=new"],
        proxy: {
            server: 'http://localhost:8888',
            username: 'USERNAME',
            password: 'PASSWORD'

    const context = await browser.newContext({
        ignoreHTTPSErrors: true,

    const page = await context.newPage();
    await page.goto('');

    const content = await page.content();

    await browser.close();

Replace USERNAME and PASSWORD by the credentials you copied earlier.


All requests made in the same session will use the same proxy instance.

Run the script:

node playwright.js

Released under the MIT License.