Skip to content

Commit

Permalink
fix: update TS template comments to reflect correct TS file extension (
Browse files Browse the repository at this point in the history
…#284)

Co-authored-by: David Hanuš <davehan@David--MacBook-Pro.local>
  • Loading branch information
DaveHanns and David Hanuš authored Aug 13, 2024
1 parent 02cc720 commit b2f2d32
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions templates/ts-crawlee-puppeteer-chrome/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ If you're looking for examples or want to learn more visit:
2. Create a configuration for proxy servers to be used during the crawling with `Actor.createProxyConfiguration()` to work around IP blocking. Use Apify Proxy or your own Proxy URLs provided and rotated according to the configuration. You can read more about proxy configuration [here](https://crawlee.dev/api/core/class/ProxyConfiguration).
3. Create an instance of Crawlee's Puppeteer Crawler with `new PuppeteerCrawler()`. You can pass [options](https://crawlee.dev/api/puppeteer-crawler/interface/PuppeteerCrawlerOptions) to the crawler constructor as:
- `proxyConfiguration` - provide the proxy configuration to the crawler
- `requestHandler` - handle each request with custom router defined in the `routes.js` file.
4. Handle requests with the custom router from `routes.js` file. Read more about custom routing for the Cheerio Crawler [here](https://crawlee.dev/api/puppeteer-crawler/function/createPuppeteerRouter)
- `requestHandler` - handle each request with custom router defined in the `routes.ts` file.
4. Handle requests with the custom router from `routes.ts` file. Read more about custom routing for the Cheerio Crawler [here](https://crawlee.dev/api/puppeteer-crawler/function/createPuppeteerRouter)
- Create a new router instance with `new createPuppeteerRouter()`
- Define default handler that will be called for all URLs that are not handled by other handlers by adding `router.addDefaultHandler(() => { ... })`
- Define additional handlers - here you can add your own handling of the page
Expand Down
2 changes: 1 addition & 1 deletion templates/ts-crawlee-puppeteer-chrome/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const {
// Create a proxy configuration that will rotate proxies from Apify Proxy.
const proxyConfiguration = await Actor.createProxyConfiguration();

// Create a PuppeteerCrawler that will use the proxy configuration and and handle requests with the router from routes.js file.
// Create a PuppeteerCrawler that will use the proxy configuration and and handle requests with the router from routes.ts file.
const crawler = new PuppeteerCrawler({
proxyConfiguration,
requestHandler: router,
Expand Down

0 comments on commit b2f2d32

Please sign in to comment.