You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
You can optionally request evaluation results, page content or snapshots.
// thenGoToPage('https://example.com',{content:true,/* HTML of the page */snapshots:true,/* or options for tile size etc... */,evaluate:function(){/* results.evaluate will equal the body width */returndocument.body.clientWidth}}).then((results)=>{// TODO})// orconst{ snapshots, evaluate}=awaitGoToPage('https://example.com',{content:true,/* HTML of the page */snapshots:true,/* or options for tile size etc... */,evaluate:function(){/* evaluate will equal the body width */returndocument.body.clientWidth}})
Evalulation with args passed between your code context and puppeteer's browser context
const{ evaluate}=awaitGoToPage('https://example.com',{evaluate:function(a,b){/* evaluate will equal the body width */returna+b},evaluateArgs:[1,2]})
Adjusting the tile size and/or snapshot limits
const{ evaluate, snapshots}=awaitGoToPage('https://example.com',{snapshots:{tileSize:1000,/* 1000px wide snapshots */limit:5/* do not snapshot the entire page, but only 5 snapshots. Depending on the tileSize this will return snapshots from all of or a portion of the page */}});
import{PuppeteerExtraPlugin}from'puppeteer-extra-plugin'import{AddPlugin,RemovePlugin}from'puppeteer-enhanced-browser'classTestPluginextendsPuppeteerExtraPlugin{constructor(opts={}){super(opts)}getname(){return'testplugin'}}// add a new pluginAddPlugin(newTestPlugin())// remove the default adblock pluginRemovePlugin('adblock')
Modify puppeteer launch options
You can setup launch option before callingGoToPage,GetBrowser or by callingCloseBrowser and then executing one of the former functions.