# Puppeteer

#### What is Puppeteer?

[**Puppeteer**](https://developer.chrome.com/docs/puppeteer/) is a JavaScript library which provides a high-level API to control Chrome or Firefox over the DevTools Protocol or WebDriver BiDi. Puppeteer runs in the headless (no visible UI) by default but can be configured to run in a visible ("headful") browser.

<figure><img src="https://340306199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1wQhlaRQzrtcn9wgMUU5%2Fuploads%2FZIeM8AfbbMj3gtraOgze%2Fimage.png?alt=media&#x26;token=ed34f57d-2e7d-4eba-a51e-4ddaa84967bc" alt=""><figcaption></figcaption></figure>

Here's how to integrate Thordata with Puppeteer.

{% stepper %}
{% step %}

### Installing Puppeteer

You must create your Puppeteer project, initiate it, and then install Puppeteer with npm and Puppeteer.

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

{% step %}

### Fill in the proxy value in Puppeteer

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

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

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

**Code Sample:**

```
const puppeteer = require('puppeteer');
(async () => {
  const browser = await puppeteer.launch({
    headless: false,
    args: ['--proxy-server=t.pr.thordata.net:9999]  
});
  const page = await browser.newPage();
    await page.authenticate({
        username: 'td-customer-USERNAME',
        password: 'PASSWORD'
    });
    await page.goto('https://ipinfo.thordata.com');
    await page.screenshot({path: 'example.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/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.
