---
title: Web Scraping with Puppeteer | TestingBot
description: 'Web scraping with Puppeteer on the TestingBot cloud: extract data from
  websites, render JavaScript-heavy pages, handle pagination and authentication, and
  run scrapers in parallel with rotating IPs.'
source_url:
  html: https://testingbot.com/support/web-automate/puppeteer/scraping
  md: https://testingbot.com/support/web-automate/puppeteer/scraping/index.md
---
# Puppeteer Scraping Tutorial

Puppeteer is a framework that allows you to control a headless browser through scripting.   
 The framework allows you to control a real browser, just like a normal user would.

This means it's useful for both automated testing, as well as scraping.   
 Scraping is an automated way to extract data from a website.

TestingBot provides a [Scrape Function](https://testingbot.com/support/functions/scrape) to scrape a page without writing any code.

## Example

To get started, please see the example below where we will scrape some text from the TestingBot website.   
 This will start a new Chrome browser in the TestingBot browser grid   
 and instruct the browser to navigate to the TestingBot website and scrape the text from a specific DOM element.

    const puppeteer = require('puppeteer')
    
    const capabilities = {
        'tb:options': {
            key: process.env.TB_KEY,
            secret: process.env.TB_SECRET
        },
        browserName: 'chrome',
        browserVersion: 'latest'
    }
    const browser = await puppeteer.connect({
      browserWSEndpoint: `wss://cloud.testingbot.com/puppeteer?capabilities=${encodeURIComponent(JSON.stringify(capabilities))}`
    })
    
    const page = await browser.newPage()
    await page.goto('https://testingbot.com')
    const title = await page.evaluate(() => {
        return document.querySelector('body > div.main > div.hero.home > div > div > p').textContent.trim()
    })
    console.log(title);
    await browser.close()

### Looking for more help?

Have questions or need more information? Reach out via email or Slack.

[Email us](https://testingbot.com/contact/new)[Slack Join our Slack](https://join.slack.com/t/testingb0t/shared_invite/zt-3bcw9xch-jk19~6XPs_xBrsAgAedkCw)
