Skip to content

Commit 69f4b18

Browse files
committed
add extract with no args to history
1 parent 0a076b5 commit 69f4b18

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/StagehandPage.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,10 +608,14 @@ export class StagehandPage {
608608

609609
// check if user called extract() with no arguments
610610
if (!instructionOrOptions) {
611+
let result: ExtractResult<T>;
611612
if (this.api) {
612-
return this.api.extract<T>({});
613+
result = await this.api.extract<T>({});
614+
} else {
615+
result = await this.extractHandler.extract();
613616
}
614-
return this.extractHandler.extract();
617+
this.addToHistory("extract", instructionOrOptions, result);
618+
return result;
615619
}
616620

617621
const options: ExtractOptions<T> =

0 commit comments

Comments
 (0)