摘要: Default runtime settings 1. Uses Headless mode Puppeteer launches Chromium in headless mode. To launch a full version of Chromium, set the 'headless' 阅读全文
posted @ 2018-10-06 16:57 FromScratch 阅读(428) 评论(0) 推荐(0) 编辑
摘要: page.exposeFunction(name, puppeteerFunction) name <string> Name of the function on the window object puppeteerFunction <function> Callback function wh 阅读全文
posted @ 2018-10-06 16:47 FromScratch 阅读(219) 评论(0) 推荐(0) 编辑
摘要: page.evaluateOnNewDocument(pageFunction, ...args) pageFunction <function|string> Function to be evaluated in browser context ...args <...Serializable> 阅读全文
posted @ 2018-10-06 16:45 FromScratch 阅读(255) 评论(0) 推荐(0) 编辑
摘要: A string can also be passed in instead of a function: const aHandle = await page.evaluateHandle('document'); // Handle for the 'document' JSHandle ins 阅读全文
posted @ 2018-10-06 16:42 FromScratch 阅读(1372) 评论(0) 推荐(0) 编辑
摘要: /在文档上下文里执行脚本,并返回结果(async () => { const browser = await puppeteer.launch({ args: ['--no-sandbox'], timeout: 10000, }); const page = await browser.newPa 阅读全文
posted @ 2018-10-06 15:32 FromScratch 阅读(204) 评论(0) 推荐(0) 编辑
摘要: const puppeteer = require('puppeteer'); puppeteer.launch().then(async browser => { const page = await browser.newPage(); //设置启用拦截 await page.setReques 阅读全文
posted @ 2018-10-06 10:15 FromScratch 阅读(582) 评论(0) 推荐(0) 编辑