Browserless allows you to build websites and applications that can be used without a web browser. This means that you can create apps that can be used offline, or that can be used on devices that don't have a web browser installed.
Some examples of things that you can build using Browserless are:
import puppeteer from 'puppeteer-core@14.1.0';
export default defineComponent({
props: {
browserless: {
type: "app",
app: "browserless",
}
},
async run({steps, $}) {
// See the browserless docs for more info:
// https://www.browserless.io/docs/
const browser = await puppeteer.connect({
browserWSEndpoint: `wss://chrome.browserless.io?token=${this.browserless.$auth.api_key}`
})
const page = await browser.newPage()
const url = "https://example.com"
const type = "png"
await page.goto(url)
const screenshot = await page.screenshot()
// export the base64-encoded screenshot for use in future steps,
// along with the image type and filename
$.export("screenshot", Buffer.from(screenshot, 'binary').toString('base64'))
$.export("type", type)
$.export("filename",`${url.replace(/[&\/\\#, +()$~%.'":*?<>{}]/g, '_')}-${+new Date()}.${type}`)
await browser.close()
},
})
Browserless uses API keys for authentication. When you connect your Browserless account, Pipedream securely stores the keys so you can easily authenticate to Browserless APIs in both code and no-code steps.
Sign-up for a browserless account, it will create a unique token that allows service interaction.