Skip to content

Commit 6a800d5

Browse files
committed
Copy improvements
1 parent c66f98d commit 6a800d5

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

docs/config/config-file.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,9 +498,7 @@ And add the following environment variable in your Trigger.dev dashboard on the
498498
PUPPETEER_EXECUTABLE_PATH: "/usr/bin/google-chrome-stable",
499499
```
500500

501-
<Note>
502-
Ensure you use `puppeteer` not `puppeteer-core` in your build configuration.
503-
</Note>
501+
Follow [this example](/examples/puppeteer) to get setup with Trigger.dev and Puppeteer in your project.
504502

505503
#### ffmpeg
506504

@@ -534,6 +532,8 @@ export default defineConfig({
534532

535533
This extension will also add the `FFMPEG_PATH` and `FFPROBE_PATH` to your environment variables, making it easy to use popular ffmpeg libraries like `fluent-ffmpeg`.
536534

535+
Follow [this example](/examples/ffmpeg-video-processing) to get setup with Trigger.dev and FFmpeg in your project.
536+
537537
#### esbuild plugins
538538

539539
You can easily add existing or custom esbuild plugins to your build process using the `esbuildPlugin` extension:

docs/examples/puppeteer.mdx

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ There are 3 example tasks to follow on this page:
1313

1414
1. [Basic example](/examples/puppeteer#basic-example)
1515
2. [Generate a PDF from a web page](/examples/puppeteer#generate-a-pdf-from-a-web-page)
16-
3. [Scrape content from a web page](/examples/puppeteer#scrape-data-from-a-website)
16+
3. [Scrape content from a web page](/examples/puppeteer#scrape-content-from-a-web-page)
1717

18-
<ScrapingWarning />
18+
<ScrapingWarning/>
1919

2020
## Build configurations
2121

@@ -34,9 +34,11 @@ export default defineConfig({
3434
});
3535
```
3636

37+
Learn more about [build configurations](/config/config-file#build-configuration) including setting default retry settings, customizing the build environment, and more.
38+
3739
## Set an environment variable
3840

39-
Add the following environment variable in your Trigger.dev dashboard on the Environment Variables page:
41+
Set the following environment variable in your [Trigger.dev dashboard](/deploy-environment-variables) or [using the SDK](/deploy-environment-variables#in-your-code):
4042

4143
```bash
4244
PUPPETEER_EXECUTABLE_PATH: "/usr/bin/google-chrome-stable",
@@ -46,7 +48,7 @@ PUPPETEER_EXECUTABLE_PATH: "/usr/bin/google-chrome-stable",
4648

4749
### Overview
4850

49-
In this example we use Puppeteer to log out the title of a web page, in this case Google.
51+
In this example we use [Puppeteer](https://pptr.dev/) to log out the title of a web page, in this case from the [Trigger.dev](https://trigger.dev) landing page.
5052

5153
### Task code
5254

@@ -60,7 +62,7 @@ export const puppeteerTask = task({
6062
const browser = await puppeteer.launch();
6163
const page = await browser.newPage();
6264

63-
await page.goto("https://google.com");
65+
await page.goto("https://trigger.dev");
6466

6567
const content = await page.title();
6668
logger.info("Content", { content });
@@ -72,13 +74,13 @@ export const puppeteerTask = task({
7274

7375
### Testing your task
7476

75-
There's no payload required for this task so you can just click "Run test" from the Test page in the dashboard.
77+
There's no payload required for this task so you can just click "Run test" from the Test page in the dashboard. Learn more about testing tasks [here](/run-tests).
7678

7779
## Generate a PDF from a web page
7880

7981
### Overview
8082

81-
In this example we use Puppeteer to generate a PDF from a web page and upload it to Cloudflare R2.
83+
In this example we use [Puppeteer](https://pptr.dev/) to generate a PDF from the [Trigger.dev](https://trigger.dev) landing page and upload it to [Cloudflare R2](https://developers.cloudflare.com/r2/).
8284

8385
### Task code
8486

@@ -102,7 +104,7 @@ export const puppeteerWebpageToPDF = task({
102104
run: async () => {
103105
const browser = await puppeteer.launch();
104106
const page = await browser.newPage();
105-
const response = await page.goto("https://google.com");
107+
const response = await page.goto("https://trigger.dev");
106108
const url = response?.url() ?? "No URL found";
107109

108110
// Generate PDF from the web page
@@ -135,15 +137,17 @@ export const puppeteerWebpageToPDF = task({
135137

136138
### Testing your task
137139

138-
There's no payload required for this task so you can just click "Run test" from the Test page in the dashboard.
140+
There's no payload required for this task so you can just click "Run test" from the Test page in the dashboard. Learn more about testing tasks [here](/run-tests).
139141

140142
## Scrape content from a web page
141143

142144
### Overview
143145

144-
In this example we use Puppeteer with a BrowserBase proxy to scrape the GitHub stars count from the [Trigger.dev](https://trigger.dev) landing page and log it out.
146+
In this example we use [Puppeteer](https://pptr.dev/) with a [BrowserBase](https://www.browserbase.com/) proxy to scrape the GitHub stars count from the [Trigger.dev](https://trigger.dev) landing page and log it out. See [this list](/examples/puppeteer#proxying) for more proxying services we recommend.
145147

146-
<ScrapingWarning />
148+
<Warning>
149+
**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.
150+
</Warning>
147151

148152
### Task code
149153

@@ -195,7 +199,7 @@ export const puppeteerScrapeWithProxy = task({
195199

196200
### Testing your task
197201

198-
There's no payload required for this task so you can just click "Run test" from the Test page in the dashboard.
202+
There's no payload required for this task so you can just click "Run test" from the Test page in the dashboard. Learn more about testing tasks [here](/run-tests).
199203

200204
<LocalDevelopment packages={"the Puppeteer library."} />
201205

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<Warning>
2-
**WEB SCRAPING WARNING:** Direct scraping of third-party websites without explicit permission using Trigger.dev Cloud is strictly prohibited and will result in immediate account suspension. If web scraping is necessary for your project, you MUST use a proxy service to comply with our terms of service.
2+
**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](/examples/puppeteer#scrape-content-from-a-web-page) using a proxy.
33
</Warning>

0 commit comments

Comments
 (0)