-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.js
34 lines (31 loc) · 1022 Bytes
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import {Cluster} from "puppeteer-cluster";
export const launchOptions = {
"executablePath": "/Users/lfy/Dev/Node/CrawlerNode/node_modules/puppeteer/.local-chromium/mac-706915/chrome-mac/Chromium.app/Contents/MacOS/Chromium",
"ignoreHTTPSErrors": true,
defaultViewport: {
width: 1920,
height: 1080
},
args: [
'--headless',
'--disable-gpu',
'--disable-dev-shm-usage',
'--disable-web-security',
'--disable-xss-auditor',
'--no-zygote',
'--no-sandbox',
'--disable-setuid-sandbox',
'--allow-running-insecure-content',
'--disable-webgl',
'--disable-popup-blocking',
'--proxy-server=http://127.0.0.1:8080'
],
};
export const clusterLaunchOptions = {
concurrency: Cluster.CONCURRENCY_CONTEXT, // 匿名上下文
maxConcurrency: 3, // 并发worker数
retryLimit: 2,
skipDuplicateUrls: true,
//monitor: true, // 显示性能消耗
puppeteerOptions: launchOptions,
};