File tree 1 file changed +3
-26
lines changed
1 file changed +3
-26
lines changed Original file line number Diff line number Diff line change 1
- import { Page } from "playwright " ;
1
+ import { Config } from "./src/config " ;
2
2
3
- type Config = {
4
- /** URL to start the crawl */
5
- url : string ;
6
- /** Pattern to match against for links on a page to subsequently crawl */
7
- match : string ;
8
- /** Selector to grab the inner text from */
9
- selector : string ;
10
- /** Don't crawl more than this many pages */
11
- maxPagesToCrawl : number ;
12
- /** File name for the finished data */
13
- outputFileName : string ;
14
- /** Optional cookie to be set. E.g. for Cookie Consent */
15
- cookie ?: { name : string ; value : string } ;
16
- /** Optional function to run for each page found */
17
- onVisitPage ?: ( options : {
18
- page : Page ;
19
- pushData : ( data : any ) => Promise < void > ;
20
- } ) => Promise < void > ;
21
- /** Optional timeout for waiting for a selector to appear */
22
- waitForSelectorTimeout ?: number ;
23
- } ;
24
-
25
- export const config : Config = {
3
+ export const defaultConfig : Config = {
26
4
url : "https://www.builder.io/c/docs/developers" ,
27
5
match : "https://www.builder.io/c/docs/**" ,
28
- selector : `.docs-builder-container` ,
29
6
maxPagesToCrawl : 50 ,
30
7
outputFileName : "../data/output.json" ,
31
- } ;
8
+ } ;
You can’t perform that action at this time.
0 commit comments