How to use the launch function from puppeteer
Find comprehensive JavaScript puppeteer.launch code examples handpicked from public code repositorys.
GitHub: heiseonline/embetty
49 50 51 52 53 54 55 56 57 58 59 60
address = family === 'IPv6' ? `[${address}]` : address return `http://${address}:${port}` } const download = async (baseDir, url) => { const browser = await puppeteer.launch() const page = await browser.newPage() const urls = [] page.on('request', (request) => {
31
938
25
+ 8 other calls in file
32 33 34 35 36 37 38 39 40 41
args.push('--proxy-server=' + configuration.getOption('proxy')); } logger.info("Launching browser with args:"); logger.info(args); browser = await puppeteer.launch({ args: args, ignoreHTTPSErrors: true, });
23
90
13
+ 8 other calls in file
GitHub: samotari/paynoway
180 181 182 183 184 185 186 187 188 189
}); }, prepareBrowser: function(options) { options = _.defaults({}, options || {}, manager.defaultBrowserOptions); return puppeteer.launch(options).then(browser => { const context = browser.defaultBrowserContext(); context.overridePermissions(this.getUrl(), ['clipboard-read']); manager.browser = browser; });
8
28
0
GitHub: apereo/cas-initializr
6 7 8 9 10 11 12 13 14 15 16
target: 'pino-pretty' } }); (async () => { const browser = await puppeteer.launch({ headless: true, ignoreHTTPSErrors: true, devtools: false, defaultViewport: null,
21
13
9
+ 18 other calls in file
440 441 442 443 444 445 446 447 448 449
} }); // it("refresh session via reading of frontend info using fetch", async function () { // await startST(); // const browser = await puppeteer.launch({ // args: ["--no-sandbox", "--disable-setuid-sandbox"] // }); // try { // const page = await browser.newPage();
12
45
7
+ 835 other calls in file
625 626 627 628 629 630 631 632 633 634
'--no-sandbox', "--shm-size=8gb", "--disk-cache-size=0", "--media-cache-size=0" ); var browser = await puppeteer.launch({ headless: true, args: args, 'ignoreHTTPSErrors': true });
6
32
2
+ 5 other calls in file
11 12 13 14 15 16 17 18 19 20
const testExtensionPath = path.join( __dirname, 'test', 'data', 'chrome-extension' ) // Open the browser, installing the test extension. this.browser = await puppeteer.launch({ headless: 'chrome', args: [ '--disable-extensions-except=' + testExtensionPath, '--load-extension=' + testExtensionPath
3
5
19
+ 5 other calls in file
GitHub: amiruldev20/mywajs
104 105 106 107 108 109 110 111 112 113
const browserArgs = [...(puppeteerOpts.args || [])]; if (!browserArgs.find(arg => arg.includes('--user-agent'))) { browserArgs.push(`--user-agent=${this.options.userAgent}`); } browser = await puppeteer.launch({ ...puppeteerOpts, args: browserArgs }); page = (await browser.pages())[0]; } await page.setUserAgent(this.options.userAgent);
1
5
0
73 74 75 76 77 78 79 80 81
} async init({ profileId }) { //! DEVONLY // { // this.browser = await puppeteer.launch({ // headless: false, // args: [/* '--disable-web-security', '--disable-features=IsolateOrigins,site-per-process', */ '--window-size=1280,720'], // });
0
3
0
GitHub: face-hh/geocord
22 23 24 25 26 27 28 29 30 31 32
/** * Start the browser in the background, takes max. 20 seconds to load, no command shall not be ran in the meantime. * @returns undefined */ async function startProcess() { browser = await puppeteer.launch({ headless: true }); page = await browser.newPage(); await page.setViewport({ width: 1920,
0
2
2
+ 10 other calls in file
GitHub: cristinel24/speedtest-cli
36 37 38 39 40 41 42 43 44 45 46 47 48
} } async function checkinternet() { const browser = await puppeteer.launch({ headless: true, args: ['--no-sandbox'] }) page = await browser.newPage(); await page.goto(url, { waitUntil: 'domcontentloaded' });
0
2
0
46 47 48 49 50 51 52 53 54 55
ignoreHTTPSErrors: true }; if (proxyConfig != null) { browserConfig.args.push('--proxy-server=' + proxyConfig.url); } const browser = await puppeteer.launch(browserConfig); const page = await browser.newPage(); await page.setUserAgent(userAgent); if (proxyConfig != null) { await page.authenticate({
2
1
0
GitHub: webatintel/tfjstest
6 7 8 9 10 11 12 13 14 15 16 17
const util = require('./util.js'); async function startContext() { if (!util.dryrun) { let context = await puppeteer.launch({ args: util['browserArgs'].split(' '), defaultViewport: null, executablePath: util['browserPath'], headless: false,
3
0
6
+ 25 other calls in file
GitHub: Ducvoccer/shopee-xu
37 38 39 40 41 42 43 44 45
if (proxy) { const proxyUrl = new URL(proxy) pupOpts['args'].push(`--proxy-server=${proxyUrl.origin}`) } this.instance = await puppeteer.launch(this.pupOpts) logger.info('browser is created') this.isLockBrowser = false
1
1
0
20 21 22 23 24 25 26 27 28 29 30 31 32
.then(async ([rows]) => { rowsDB.push(...rows) }) }) const browser = await puppeteer.launch(); const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; const uniqueArray = [];
1
1
0
134 135 136 137 138 139 140 141 142 143
'--disable-setuid-sandbox' ], ignoreDefaultArgs: ["--hide-scrollbars"]*/ }; const browser = await puppeteer.launch(browserOptions); const page = await browser.newPage(); var allData = []; var token;
0
1
2
+ 21 other calls in file
27 28 29 30 31 32 33 34 35 36
return res.status(400).send({ error: 'URL is required.' }); } try { console.log('Opening URL: ', url); browser = await puppeteer.launch({ headless: false }); page = await browser.newPage(); await page.goto(url); return res.status(200).send({ message: 'URL opened successfully.' });
0
1
0
+ 2 other calls in file
28 29 30 31 32 33 34 35 36 37 38 39
'--proxy-pac-url=data:application/x-ns-proxy-autoconfig;base64,'+PAC_B64, ]; } (async function(){ const browser = await puppeteer.launch(puppeter_args); function ask_for_url(socket) { socket.state = 'URL'; socket.write('Please send me a URL to open.\n');
0
1
0
GitHub: Alwexis/PokemonTCG
25 26 27 28 29 30 31 32 33 34 35
})) } async function scrapExpansions() { console.log('Scraping expansions...'); const browser = await puppeteer.launch({ headless: true }); const page = await browser.newPage(); page.setDefaultTimeout(60000); page.setDefaultNavigationTimeout(60000); await page.goto(__EXPANSIONS_BASE_URL__);
0
2
1
+ 74 other calls in file
926 927 928 929 930 931 932 933 934 935 936 937 938
async function run() { let start = true; log("START ", account, new Date().toLocaleString()); const browser = await puppeteer.launch(puppeteer_options); //const page = await browser.newPage(); let [page] = await browser.pages();
1
1
1
+ 16 other calls in file
puppeteer.launch is the most popular function in puppeteer (5121 examples)