2

I am using puppeteer to take a screen grab. To load the required page however, a context needs to be set in the SessionStorage (of the browser page). I am not able to do achieve that as of now. Any help would be appreciated!.

browser.newPage().then(Page => { //maybe set some context here so that the page can access the context from sessionStorage page.goto(url).then( .....)})

AnweshCR7
  • 62
  • 6

1 Answers1

1

Couldn't something like this work?

        await page.goto(url);
        await page.evaluate(() => {
            sessionStorage.setItem(...);
        });
Jazzy
  • 5,536
  • 9
  • 45
  • 70
  • Hm... we since took a different approach altogether, so I don't really know if it would work. However, I need the data from the sessionStorage at page load, (to authorize the user and not send him to the login screen for example). So, once we have done a page.goto(PageUrl), even if it gets set, we wont have much use for it then. – AnweshCR7 Mar 25 '19 at 08:55