Skip to content

Commit 4c892e6

Browse files
committed
feat: add waitForSelectorTimeout config option
1 parent 29fc934 commit 4c892e6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ type Config = {
1818
page: Page;
1919
pushData: (data: any) => Promise<void>;
2020
}) => Promise<void>;
21+
/** Optional timeout for waiting for a selector to appear */
22+
waitForSelectorTimeout?: number;
2123
};
2224

2325
export const config: Config = {

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ if (process.env.NO_CRAWL !== "true") {
3333
log.info(`Crawling ${request.loadedUrl}...`);
3434

3535
await page.waitForSelector(config.selector, {
36-
timeout: 1000,
36+
timeout: config.waitForSelectorTimeout ?? 1000,
3737
});
3838

3939
const html = await getPageHtml(page);

0 commit comments

Comments
 (0)