Skip to content

Commit

Permalink
Merge pull request #50 from Umar-Azam/main
Browse files Browse the repository at this point in the history
modified config.ts to fix containerized execution
  • Loading branch information
steve8708 authored Nov 23, 2023
2 parents 550f1e6 + 2233cbc commit 27b65d3
Showing 1 changed file with 3 additions and 26 deletions.
29 changes: 3 additions & 26 deletions containerapp/data/config.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,8 @@
import { Page } from "playwright";
import { Config } from "./src/config";

type Config = {
/** URL to start the crawl */
url: string;
/** Pattern to match against for links on a page to subsequently crawl */
match: string;
/** Selector to grab the inner text from */
selector: string;
/** Don't crawl more than this many pages */
maxPagesToCrawl: number;
/** File name for the finished data */
outputFileName: string;
/** Optional cookie to be set. E.g. for Cookie Consent */
cookie?: { name: string; value: string };
/** Optional function to run for each page found */
onVisitPage?: (options: {
page: Page;
pushData: (data: any) => Promise<void>;
}) => Promise<void>;
/** Optional timeout for waiting for a selector to appear */
waitForSelectorTimeout?: number;
};

export const config: Config = {
export const defaultConfig: Config = {
url: "https://www.builder.io/c/docs/developers",
match: "https://www.builder.io/c/docs/**",
selector: `.docs-builder-container`,
maxPagesToCrawl: 50,
outputFileName: "../data/output.json",
};
};

0 comments on commit 27b65d3

Please sign in to comment.