Function
waitForXPath
(page: Page, xpath: string, timeout: number)
Source from the content-addressed store, hash-verified
| 32 | } |
| 33 | |
| 34 | export async function waitForXPath(page: Page, xpath: string, timeout: number) { |
| 35 | await page.waitForFunction( |
| 36 | (xpath) => { |
| 37 | const elements = document.evaluate( |
| 38 | xpath, |
| 39 | document, |
| 40 | null, |
| 41 | XPathResult.ANY_TYPE, |
| 42 | null, |
| 43 | ); |
| 44 | return elements.iterateNext() !== null; |
| 45 | }, |
| 46 | xpath, |
| 47 | { timeout }, |
| 48 | ); |
| 49 | } |
| 50 | |
| 51 | export async function crawl(config: Config) { |
| 52 | configSchema.parse(config); |
Tested by
no test coverage detected