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

Added the ability to crawl content links #15

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ type Config = {
/** File name for the finished data */
outputFileName: string;
/** Optional cookie to be set. E.g. for Cookie Consent */
cookie?: {name: string; value: string}
cookie?: { name: string; value: string };
/** Selector for the area of the page that should be processed. */
withoutSelector: string;
/** List of HTML attributes to retain during content processing. */
attributeWhitelist: string[];
/** Flag to determine if content links should be crawled. */
isContentLink: boolean;
/** Optional function to run for each page found */
onVisitPage?: (options: {
page: Page;
Expand All @@ -23,9 +29,12 @@ type Config = {
};

export const config: Config = {
url: "https://www.builder.io/c/docs/developers",
match: "https://www.builder.io/c/docs/**",
selector: `.docs-builder-container`,
url: "https://react.dev/learn",
match: "https://react.dev/learn",
selector: `main`,
isContentLink: false,
withoutSelector: `main`,
attributeWhitelist: ["href", "title"],
maxPagesToCrawl: 50,
outputFileName: "output.json",
outputFileName: "nuxt.json",
};
Loading