chore: lint
This commit is contained in:
@@ -281,22 +281,22 @@ export default class Interpreter extends EventEmitter {
|
||||
|
||||
const scrapeResults: Record<string, string>[] = await page.evaluate((s) => window.scrape(s ?? null), selector);
|
||||
await this.options.serializableCallback(scrapeResults);
|
||||
},
|
||||
},
|
||||
|
||||
scrapeSchema: async (schema: Record<string, string>) => {
|
||||
await this.ensureScriptsLoaded(page);
|
||||
scrapeSchema: async (schema: Record<string, string>) => {
|
||||
await this.ensureScriptsLoaded(page);
|
||||
|
||||
const handleLists = await Promise.all(
|
||||
Object.values(schema).map((selector) => page.$$(selector)),
|
||||
Object.values(schema).map((selector) => page.$$(selector)),
|
||||
);
|
||||
|
||||
const namedHandleLists = Object.fromEntries(
|
||||
Object.keys(schema).map((key, i) => [key, handleLists[i]]),
|
||||
Object.keys(schema).map((key, i) => [key, handleLists[i]]),
|
||||
);
|
||||
|
||||
const scrapeResult = await page.evaluate((n) => window.scrapeSchema(n), namedHandleLists);
|
||||
await this.options.serializableCallback(scrapeResult);
|
||||
},
|
||||
},
|
||||
|
||||
scroll: async (pages?: number) => {
|
||||
await page.evaluate(async (pagesInternal) => {
|
||||
|
||||
Reference in New Issue
Block a user