WEB SCRAPING: When web scraping, you MUST use a proxy to comply with our terms of service. Direct scraping of third-party websites without the site owner’s permission using Trigger.dev Cloud is prohibited and will result in account suspension. See this example which uses a proxy.
To use all examples on this page, you’ll first need to add these build settings to your trigger.config.ts file:
trigger.config.ts
Copy
Ask AI
import { defineConfig } from "@trigger.dev/sdk/v3";import { puppeteer } from "@trigger.dev/build/extensions/puppeteer";export default defineConfig({ project: "<project ref>", // Your other config settings... build: { // This is required to use the Puppeteer library extensions: [puppeteer()], },});
Learn more about the trigger.config.ts file including setting default retry settings, customizing the build environment, and more.
In this example we use Puppeteer with a BrowserBase proxy to scrape the GitHub stars count from the Trigger.dev landing page and log it out. See this list for more proxying services we recommend.
When web scraping, you MUST use the technique below which uses a proxy with Puppeteer. Direct
scraping without using browserWSEndpoint is prohibited and will result in account suspension.
To test this example task locally, be sure to install any packages from the build extensions you added to your trigger.config.ts file to your local machine. In this case, you need to install .
If you’re using Trigger.dev Cloud and Puppeteer or any other tool to scrape content from websites you don’t own, you’ll need to proxy your requests. If you don’t you’ll risk getting our IP address blocked and we will ban you from our service. You must always have permission from the website owner to scrape their content.Here are a list of proxy services we recommend: