primary-violetP
Apify & Crawlee2y ago
8 replies
primary-violet

How to inject storage state into crawler's page

How can a storageState be injected into crawler's page before the page is created? Basically, how to reproduce this but using storageState from the session instead:
        prePageCreateHooks: [
            async (pageId, browserController, pageOptions) => {
                const storageState = await KeyValueStore.getValue('storageState');
                if (pageOptions && storageState)
                    pageOptions.storageState = storageState;
            },
        ],
Was this page helpful?