# Puppeteer

[**Puppeteer**](https://developer.chrome.com/docs/puppeteer/) is a Node library that provides a high-level API to control headless Chrome or Chromium over the DevTools Protocol.

To integrate Puppeteer with Oxylabs [**Residential Proxies**](https://oxylabs.io/products/residential-proxy-pool)**,** follow the steps below or watch this video tutorial:

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

**Step 1.** Install Node.js and a code editor of your choice. (Skip this step If you already have it)

**Step 2.** Create a Node.js project and install the required packages.&#x20;

**Step 3.** Within Puppeteer, fill in the value, for example:

**Proxy server:** `pr.oxylabs.io:7777`

{% hint style="info" %}
You can also use random or sticky country-specific entries. For example, if you enter `us-pr.oxylabs.io:10000`, you’ll acquire a US exit node. If you enter `10001` under **port**, you’ll receive the US exit node with a sticky session. You can find a complete list of country-specific random proxy entry nodes [**here**](https://developers.oxylabs.io/proxies/residential-proxies/country-specific-entry-nodes#random-proxy-entry-nodes) and a list of sticky proxy entry nodes - [**here**](https://developers.oxylabs.io/proxies/residential-proxies/country-specific-entry-nodes#sticky-proxy-entry-nodes).
{% endhint %}

**Step 4.** Under the `'page.authenticate'`, input your Oxylabs proxy username and password.

An example of a code looks like this:

```
const puppeteer = require('puppeteer');
(async () => {
  const browser = await puppeteer.launch({
    headless: false,
    args: ['--proxy-server=pr.oxylabs.io:7777]  
});
  const page = await browser.newPage();
    await page.authenticate({
        username: 'USERNAME',
        password: 'PASSWORD'
    });
    await page.goto('https://ip.oxylabs.io');
    await page.screenshot({path: 'example.png'});
    await browser.close();
})();
```

And that's it! You've successfully integrated Oxylabs [**Residential Proxies**](https://oxylabs.io/products/residential-proxy-pool) with Puppeteer.

If you want to learn more about web scraping with Puppeteer, read our [**blog post**](https://oxylabs.io/blog/puppeteer-tutorial).

Find the original Puppeteer integration blog post [here](https://oxylabs.io/resources/integrations/puppeteer).


---

# 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://developers.oxylabs.io/proxies/integration-guides/3rd-party-integrations/puppeteer.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.
