@crawlee/templates 3.0.3-beta.18 → 3.0.3-beta.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/cheerio-js/Dockerfile +3 -1
- package/templates/cheerio-js/src/main.js +2 -8
- package/templates/cheerio-js/src/routes.js +1 -1
- package/templates/cheerio-ts/Dockerfile +3 -3
- package/templates/cheerio-ts/src/main.ts +2 -13
- package/templates/cheerio-ts/src/routes.ts +1 -1
- package/templates/playwright-js/Dockerfile +3 -1
- package/templates/playwright-js/src/main.js +2 -8
- package/templates/playwright-js/src/routes.js +1 -1
- package/templates/playwright-ts/Dockerfile +3 -3
- package/templates/playwright-ts/src/main.ts +2 -13
- package/templates/playwright-ts/src/routes.ts +1 -1
- package/templates/puppeteer-js/Dockerfile +3 -1
- package/templates/puppeteer-js/src/main.js +2 -8
- package/templates/puppeteer-js/src/routes.js +1 -1
- package/templates/puppeteer-ts/Dockerfile +3 -3
- package/templates/puppeteer-ts/src/main.ts +2 -13
- package/templates/puppeteer-ts/src/routes.ts +1 -1
package/package.json
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
// For more information, see https://crawlee.dev/
|
|
2
|
-
import { CheerioCrawler,
|
|
2
|
+
import { CheerioCrawler, ProxyConfiguration } from 'crawlee';
|
|
3
3
|
import { router } from './routes.js';
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
if (debug) {
|
|
8
|
-
log.setLevel(log.LEVELS.DEBUG);
|
|
9
|
-
}
|
|
5
|
+
const startUrls = ['https://crawlee.dev'];
|
|
10
6
|
|
|
11
7
|
const crawler = new CheerioCrawler({
|
|
12
8
|
// proxyConfiguration: new ProxyConfiguration({ proxyUrls: ['...'] }),
|
|
13
|
-
// Be nice to the websites. Remove to unleash full power.
|
|
14
|
-
maxConcurrency: 50,
|
|
15
9
|
requestHandler: router,
|
|
16
10
|
});
|
|
17
11
|
|
|
@@ -5,7 +5,7 @@ export const router = createCheerioRouter();
|
|
|
5
5
|
router.addDefaultHandler(async ({ enqueueLinks, log }) => {
|
|
6
6
|
log.info(`Handle Start URLs`);
|
|
7
7
|
await enqueueLinks({
|
|
8
|
-
globs: ['https://crawlee.dev
|
|
8
|
+
globs: ['https://crawlee.dev/**'],
|
|
9
9
|
label: 'DETAIL',
|
|
10
10
|
});
|
|
11
11
|
});
|
|
@@ -5,7 +5,7 @@ FROM apify/actor-node:16 AS builder
|
|
|
5
5
|
|
|
6
6
|
# Second, copy the TS source files, package.json and package-lock.json since it should be
|
|
7
7
|
# the only files that affects the installation and build in the next step
|
|
8
|
-
COPY package*.json ./
|
|
8
|
+
COPY package*.json crawlee?json ./
|
|
9
9
|
COPY src ./src
|
|
10
10
|
|
|
11
11
|
# Install all dependencies (including dev deps) and build the project
|
|
@@ -14,8 +14,8 @@ RUN npm install --include=dev && npm run build
|
|
|
14
14
|
# Create final image
|
|
15
15
|
FROM apify/actor-node:16
|
|
16
16
|
|
|
17
|
-
# Copy only necessary files
|
|
18
|
-
COPY --from=builder /usr/src/app/package.json ./
|
|
17
|
+
# Copy only necessary files (crawlee.json might not exist, so we need the regexp trick with `crawlee?json`)
|
|
18
|
+
COPY --from=builder /usr/src/app/package.json /usr/src/app/crawlee?json ./
|
|
19
19
|
COPY --from=builder /usr/src/app/README.md ./
|
|
20
20
|
COPY --from=builder /usr/src/app/dist ./dist
|
|
21
21
|
|
|
@@ -1,22 +1,11 @@
|
|
|
1
1
|
// For more information, see https://crawlee.dev/
|
|
2
|
-
import { CheerioCrawler,
|
|
2
|
+
import { CheerioCrawler, ProxyConfiguration } from 'crawlee';
|
|
3
3
|
import { router } from './routes.js';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
startUrls: string[];
|
|
7
|
-
debug?: boolean;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const { startUrls = ['https://crawlee.dev'], debug } = await KeyValueStore.getInput<InputSchema>() ?? {};
|
|
11
|
-
|
|
12
|
-
if (debug) {
|
|
13
|
-
log.setLevel(log.LEVELS.DEBUG);
|
|
14
|
-
}
|
|
5
|
+
const startUrls = ['https://crawlee.dev'];
|
|
15
6
|
|
|
16
7
|
const crawler = new CheerioCrawler({
|
|
17
8
|
// proxyConfiguration: new ProxyConfiguration({ proxyUrls: ['...'] }),
|
|
18
|
-
// Be nice to the websites. Remove to unleash full power.
|
|
19
|
-
maxConcurrency: 50,
|
|
20
9
|
requestHandler: router,
|
|
21
10
|
});
|
|
22
11
|
|
|
@@ -5,7 +5,7 @@ export const router = createCheerioRouter();
|
|
|
5
5
|
router.addDefaultHandler(async ({ enqueueLinks, log }) => {
|
|
6
6
|
log.info(`Handle Start URLs`);
|
|
7
7
|
await enqueueLinks({
|
|
8
|
-
globs: ['https://crawlee.dev
|
|
8
|
+
globs: ['https://crawlee.dev/**'],
|
|
9
9
|
label: 'DETAIL',
|
|
10
10
|
});
|
|
11
11
|
});
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
// For more information, see https://crawlee.dev/
|
|
2
|
-
import {
|
|
2
|
+
import { PlaywrightCrawler, ProxyConfiguration } from 'crawlee';
|
|
3
3
|
import { router } from './routes.js';
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
if (debug) {
|
|
8
|
-
log.setLevel(log.LEVELS.DEBUG);
|
|
9
|
-
}
|
|
5
|
+
const startUrls = ['https://crawlee.dev'];
|
|
10
6
|
|
|
11
7
|
const crawler = new PlaywrightCrawler({
|
|
12
8
|
// proxyConfiguration: new ProxyConfiguration({ proxyUrls: ['...'] }),
|
|
13
|
-
// Be nice to the websites. Remove to unleash full power.
|
|
14
|
-
maxConcurrency: 50,
|
|
15
9
|
requestHandler: router,
|
|
16
10
|
});
|
|
17
11
|
|
|
@@ -5,7 +5,7 @@ export const router = createPlaywrightRouter();
|
|
|
5
5
|
router.addDefaultHandler(async ({ enqueueLinks, log }) => {
|
|
6
6
|
log.info(`Handle Start URLs`);
|
|
7
7
|
await enqueueLinks({
|
|
8
|
-
globs: ['https://crawlee.dev
|
|
8
|
+
globs: ['https://crawlee.dev/**'],
|
|
9
9
|
label: 'DETAIL',
|
|
10
10
|
});
|
|
11
11
|
});
|
|
@@ -5,7 +5,7 @@ FROM apify/actor-node:16 AS builder
|
|
|
5
5
|
|
|
6
6
|
# Second, copy the TS source files, package.json and package-lock.json since it should be
|
|
7
7
|
# the only files that affects the installation and build in the next step
|
|
8
|
-
COPY package*.json ./
|
|
8
|
+
COPY package*.json crawlee?json ./
|
|
9
9
|
COPY src ./src
|
|
10
10
|
|
|
11
11
|
# Install all dependencies (including dev deps) and build the project
|
|
@@ -14,8 +14,8 @@ RUN npm install --include=dev && npm run build
|
|
|
14
14
|
# Create final image
|
|
15
15
|
FROM apify/actor-node-playwright-chrome:16
|
|
16
16
|
|
|
17
|
-
# Copy only necessary files
|
|
18
|
-
COPY --from=builder /usr/src/app/package.json ./
|
|
17
|
+
# Copy only necessary files (crawlee.json might not exist, so we need the regexp trick with `crawlee?json`)
|
|
18
|
+
COPY --from=builder /usr/src/app/package.json /usr/src/app/crawlee?json ./
|
|
19
19
|
COPY --from=builder /usr/src/app/README.md ./
|
|
20
20
|
COPY --from=builder /usr/src/app/dist ./dist
|
|
21
21
|
|
|
@@ -1,22 +1,11 @@
|
|
|
1
1
|
// For more information, see https://crawlee.dev/
|
|
2
|
-
import {
|
|
2
|
+
import { PlaywrightCrawler, ProxyConfiguration } from 'crawlee';
|
|
3
3
|
import { router } from './routes.js';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
startUrls: string[];
|
|
7
|
-
debug?: boolean;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const { startUrls = ['https://crawlee.dev'], debug } = await KeyValueStore.getInput<InputSchema>() ?? {};
|
|
11
|
-
|
|
12
|
-
if (debug) {
|
|
13
|
-
log.setLevel(log.LEVELS.DEBUG);
|
|
14
|
-
}
|
|
5
|
+
const startUrls = ['https://crawlee.dev'];
|
|
15
6
|
|
|
16
7
|
const crawler = new PlaywrightCrawler({
|
|
17
8
|
// proxyConfiguration: new ProxyConfiguration({ proxyUrls: ['...'] }),
|
|
18
|
-
// Be nice to the websites. Remove to unleash full power.
|
|
19
|
-
maxConcurrency: 50,
|
|
20
9
|
requestHandler: router,
|
|
21
10
|
});
|
|
22
11
|
|
|
@@ -5,7 +5,7 @@ export const router = createPlaywrightRouter();
|
|
|
5
5
|
router.addDefaultHandler(async ({ enqueueLinks, log }) => {
|
|
6
6
|
log.info(`Handle Start URLs`);
|
|
7
7
|
await enqueueLinks({
|
|
8
|
-
globs: ['https://crawlee.dev
|
|
8
|
+
globs: ['https://crawlee.dev/**'],
|
|
9
9
|
label: 'DETAIL',
|
|
10
10
|
});
|
|
11
11
|
});
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
// For more information, see https://crawlee.dev/
|
|
2
|
-
import {
|
|
2
|
+
import { PuppeteerCrawler, ProxyConfiguration } from 'crawlee';
|
|
3
3
|
import { router } from './routes.js';
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
if (debug) {
|
|
8
|
-
log.setLevel(log.LEVELS.DEBUG);
|
|
9
|
-
}
|
|
5
|
+
const startUrls = ['https://crawlee.dev'];
|
|
10
6
|
|
|
11
7
|
const crawler = new PuppeteerCrawler({
|
|
12
8
|
// proxyConfiguration: new ProxyConfiguration({ proxyUrls: ['...'] }),
|
|
13
|
-
// Be nice to the websites. Remove to unleash full power.
|
|
14
|
-
maxConcurrency: 50,
|
|
15
9
|
requestHandler: router,
|
|
16
10
|
});
|
|
17
11
|
|
|
@@ -5,7 +5,7 @@ export const router = createPuppeteerRouter();
|
|
|
5
5
|
router.addDefaultHandler(async ({ enqueueLinks, log }) => {
|
|
6
6
|
log.info(`Handle Start URLs`);
|
|
7
7
|
await enqueueLinks({
|
|
8
|
-
globs: ['https://crawlee.dev
|
|
8
|
+
globs: ['https://crawlee.dev/**'],
|
|
9
9
|
label: 'DETAIL',
|
|
10
10
|
});
|
|
11
11
|
});
|
|
@@ -5,7 +5,7 @@ FROM apify/actor-node:16 AS builder
|
|
|
5
5
|
|
|
6
6
|
# Second, copy the TS source files, package.json and package-lock.json since it should be
|
|
7
7
|
# the only files that affects the installation and build in the next step
|
|
8
|
-
COPY package*.json ./
|
|
8
|
+
COPY package*.json crawlee?json ./
|
|
9
9
|
COPY src ./src
|
|
10
10
|
|
|
11
11
|
# Install all dependencies (including dev deps) and build the project
|
|
@@ -14,8 +14,8 @@ RUN npm install --include=dev && npm run build
|
|
|
14
14
|
# Create final image
|
|
15
15
|
FROM apify/actor-node-puppeteer-chrome:16
|
|
16
16
|
|
|
17
|
-
# Copy only necessary files
|
|
18
|
-
COPY --from=builder /usr/src/app/package.json ./
|
|
17
|
+
# Copy only necessary files (crawlee.json might not exist, so we need the regexp trick with `crawlee?json`)
|
|
18
|
+
COPY --from=builder /usr/src/app/package.json /usr/src/app/crawlee?json ./
|
|
19
19
|
COPY --from=builder /usr/src/app/README.md ./
|
|
20
20
|
COPY --from=builder /usr/src/app/dist ./dist
|
|
21
21
|
|
|
@@ -1,22 +1,11 @@
|
|
|
1
1
|
// For more information, see https://crawlee.dev/
|
|
2
|
-
import {
|
|
2
|
+
import { PuppeteerCrawler, log } from 'crawlee';
|
|
3
3
|
import { router } from './routes.js';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
startUrls: string[];
|
|
7
|
-
debug?: boolean;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const { startUrls = ['https://crawlee.dev'], debug } = await KeyValueStore.getInput<InputSchema>() ?? {};
|
|
11
|
-
|
|
12
|
-
if (debug) {
|
|
13
|
-
log.setLevel(log.LEVELS.DEBUG);
|
|
14
|
-
}
|
|
5
|
+
const startUrls = ['https://crawlee.dev'];
|
|
15
6
|
|
|
16
7
|
const crawler = new PuppeteerCrawler({
|
|
17
8
|
// proxyConfiguration: new ProxyConfiguration({ proxyUrls: ['...'] }),
|
|
18
|
-
// Be nice to the websites. Remove to unleash full power.
|
|
19
|
-
maxConcurrency: 50,
|
|
20
9
|
requestHandler: router,
|
|
21
10
|
});
|
|
22
11
|
|
|
@@ -5,7 +5,7 @@ export const router = createPuppeteerRouter();
|
|
|
5
5
|
router.addDefaultHandler(async ({ enqueueLinks, log }) => {
|
|
6
6
|
log.info(`Handle Start URLs`);
|
|
7
7
|
await enqueueLinks({
|
|
8
|
-
globs: ['https://crawlee.dev
|
|
8
|
+
globs: ['https://crawlee.dev/**'],
|
|
9
9
|
label: 'DETAIL',
|
|
10
10
|
});
|
|
11
11
|
});
|