Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cookie example #158

Open
cmbcbe opened this issue Mar 10, 2024 · 0 comments
Open

cookie example #158

cmbcbe opened this issue Mar 10, 2024 · 0 comments

Comments

@cmbcbe
Copy link

cmbcbe commented Mar 10, 2024

hello,

i cannot find a way to set cookie for authenticated crawling.
I have export cookie from authenticated session with chrome extension "export this cookie" https://chromewebstore.google.com/detail/exportthiscookie/dannllckdimllhkiplchkcaoheibealk
Now i try to put in my config.ts without success.
Here is my code

import { Config } from "./src/config";

export const defaultConfig: Config = {
  url: "https://doku.mydomain.com",
  match: "https://doku.mydomain.com/**",
  maxPagesToCrawl: 5000,
  outputFileName: "doku.json",
  maxTokens: 2000000,
  cookie: {"DokuWiki":"os2svsfsplem3e6f5npkag","FCK_NmSp":"main_page","plugin_acmenu_open_items":"[]","DW7fa065a06cb74b536c1e56ac6d3":"Y2VkcmljLm1hcmNvdXg%3D%7C1%7CT7Ljmh7OC%2Fx5f%2FzqpVGSYS%2FkZzW%2BTI%2FbREg29quTC8ySrWo2R9SOcvOeu","FCK_NmSp_acl":"os2svsfsplem3e6f590nbnpkag","FCK_SCAYT_AUTO":"on","FCK_SCAYT_LANG":"fr_FR"}
};

this give the error
The expected type comes from property 'cookie' which is declared here on type '{ url: string; match: (string | string[]) & (string | string[] | undefined); maxPagesToCrawl: number; outputFileName: string; exclude?: string | string[] | undefined; selector?: string | undefined; ... 5 more ...; maxTokens?: number | undefined; }'

Is it possible to get a syntax example of cookie usage? Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant