How should I configure token in localStorage? #1883
Replies: 2 comments
-
This really depends on how the site works, you should obverse and mimic the real requests, check if they have some preNavigationHooks: [
async ({ session, request }) => {
// cookies is an array of objects, the same as you can get from the crawler's session via `session.getCookies()`
session?.setCookies(cookies, request.url);
}, |
Beta Was this translation helpful? Give feedback.
-
It seems the website keep the token in
But it return the following error (Access is denied):
How should I resolve it? |
Beta Was this translation helpful? Give feedback.
-
My target website save
token
key-value in a cookie after login.Now I want pass the token manually to the crawler to crawl some pages that need authorization.
How should I pass it to the website in my crawler?
Should I create cookie or pass it as header?
Currently I have the following code:
Beta Was this translation helpful? Give feedback.
All reactions