# Playwright

#### What is Playwright?

Built by Microsoft, [Playwright](https://playwright.dev/) is a Node.js library that, with a single API, automates websites and web apps running on Chromium, Firefox, and WebKit. These APIs can be used by developers writing JavaScript code to create new browser pages, navigate to URLs, and then interact with elements on a page. In addition, since Microsoft Edge is built on the open-source Chromium web platform, Playwright can also automate Microsoft Edge.

<figure><img src="/files/oM8xorNO7HBx4U17OUFQ" alt=""><figcaption></figcaption></figure>

Here's how to integrate Thordata with Playwright.

{% stepper %}
{% step %}

### Installing Playwright

Get started by installing Playwright using npm, yarn or pnpm. Alternatively you can also get started and run your tests using the VS Code Extension.

[**Click here**](https://playwright.dev/docs/intro) to view the detailed installation tutorial
{% endstep %}

{% step %}

### Fill in the proxy value in Playwright

**Server:** `t.pr.thordata.net:9999`

**Username:** `td-customer-USERNAME`

**Password:** `PASSWORD`
{% endstep %}
{% endstepper %}

**Code Sample:**

```
const playwright = require('playwright');
(async () => {
    for (const browserType of ['chromium', 'firefox', 'webkit']) {
        const browser = await playwright[browserType].launch({
            headless: false,
            proxy: {
                server: 'http://t.pr.thordata.net:9999',
                username: 'td-customer-USERNAME',
                password: 'PASSWORD'
            },
        });
        const context = await browser.newContext();
        const page = await context.newPage();
        await page.goto('https://ipinfo.thordata.com');
        await page.screenshot({ path: `${browserType}.png` });
        await browser.close();
    }
})();
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.thordata.com/doc/proxies/integration-tutorial/residential-proxies-integration/playwright.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
