> For the complete documentation index, see [llms.txt](https://developers.oxylabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.oxylabs.io/integrations/pt-br/proxy-integrations/residential-proxies-guides/playwright.md).

# Playwright

[**Playwright**](https://playwright.dev/) é uma biblioteca Node.js que permite criar scripts e automatizar navegadores usando a mesma API, como Chrome, Firefox e Safari. É um framework conveniente para fins de automação e testes.&#x20;

Para integrar o Playwright com Oxylabs [**Residential Proxies**](https://oxylabs.io/products/residential-proxy-pool)**,** siga as etapas abaixo ou assista a este tutorial em vídeo:

{% embed url="<https://youtu.be/KIsQ7ggB5DU>" %}

**Etapa 1.** Instale o Node.js e um editor de código de sua preferência. (Pule esta etapa se você já o tiver)

**Etapa 2.** Crie um projeto Node.js e instale os pacotes necessários.&#x20;

**Etapa 3.** No Playwright, preencha o `'proxy'` valores:

**Servidor**: `'http://pr.oxylabs.io:7777'`

{% hint style="info" %}
Você também pode usar entradas aleatórias ou fixas específicas por país. Por exemplo, se você inserir `http://us-pr.oxylabs.io:10000`, você obterá um nó de saída dos EUA. Se você inserir `10001` em **porta**, você receberá o nó de saída dos EUA com uma sessão fixa. Você pode encontrar uma lista completa de nós de entrada de proxy aleatórios específicos por país [**aqui**](https://developers.oxylabs.io/proxies/residential-proxies/country-specific-entry-nodes#random-proxy-entry-nodes) e uma lista de nós de entrada de proxy fixos - [**aqui**](https://developers.oxylabs.io/proxies/residential-proxies/country-specific-entry-nodes#sticky-proxy-entry-nodes).
{% endhint %}

**Username:** `'Oxylabs' proxy user username`

**Password:** `'Oxylabs' proxy user password`

Um exemplo de código é assim:

```
const playwright = require('playwright');
(async () => {
    for (const browserType of ['chromium', 'firefox', 'webkit']) {
        const browser = await playwright[browserType].launch({
            headless: false,
            proxy: {
                server: 'http://pr.oxylabs.io:7777',
                username: 'USERNAME',
                password: 'PASSWORD'
            },
        });
        const context = await browser.newContext();
        const page = await context.newPage();
        await page.goto('https://ip.oxylabs.io');
        await page.screenshot({ path: `${browserType}.png` });
        await browser.close();
    }
})();
```

E é isso! Você integrou com sucesso a Oxylabs [**Residential Proxies**](https://oxylabs.io/products/residential-proxy-pool) com Playwright.

Se você quiser aprender mais sobre web scraping com Playwright, leia nosso [**post do blog**](https://oxylabs.io/blog/playwright-web-scraping).

Encontre a publicação original do blog sobre a integração do Playwright [aqui](https://oxylabs.io/resources/integrations/playwright).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://developers.oxylabs.io/integrations/pt-br/proxy-integrations/residential-proxies-guides/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.
