with Cloudflare Browser Rendering and Puppeteer?
Fetches rendered HTML content from provided URL or HTML. See the documentation
Get the HTML of a webpage using Puppeteer. See the documentation for details.
Fetches rendered PDF from provided URL or HTML. See the documentation
Get the title of a webpage using Puppeteer. See the documentation
Takes a screenshot of a webpage from provided URL or HTML. See the documentation
import { axios } from "@pipedream/platform"
export default defineComponent({
  props: {
    cloudflare_browser_rendering: {
      type: "app",
      app: "cloudflare_browser_rendering",
    }
  },
  async run({steps, $}) {
    const data = {
      "url": `https://pipedream.com?via=go`,
    }
    return await axios($, {
      method: "post",
      url: `https://api.cloudflare.com/client/v4/accounts/${this.cloudflare_browser_rendering.$auth.account_id}/browser-rendering/content`,
      headers: {
        Authorization: `Bearer ${this.cloudflare_browser_rendering.$auth.api_token}`,
        "content-type": `application/json`,
      },
      data,
    })
  },
})
Puppeteer is a Node.js library which provides a high-level API to control Chrome/Chromium over the DevTools Protocol. Puppeteer runs in headless mode on Chromium on Pipedream.
Using Puppeteer you can perform tasks including:
 import { puppeteer } from '@pipedream/browsers';
export default defineComponent({
  async run({steps, $}) {
    const browser = await puppeteer.browser();
    
    // Interact with the web page programmatically
    // See Puppeeter's Page documentation for available methods:
    // https://pptr.dev/api/puppeteer.page
    const page = await browser.newPage();
    await page.goto('https://pipedream.com/');
    const title = await page.title();
    const content = await page.content();
    // The browser needs to be closed, otherwise the step will hang
    await browser.close();
    return { title, content }
  },
})