Merge pull request #264 from getmaxun/listout-fix
fix: scrapeList empty output preview
This commit is contained in:
@@ -140,19 +140,22 @@ export class WorkflowGenerator {
|
|||||||
socket.on('decision', async ({ pair, actionType, decision }) => {
|
socket.on('decision', async ({ pair, actionType, decision }) => {
|
||||||
const id = browserPool.getActiveBrowserId();
|
const id = browserPool.getActiveBrowserId();
|
||||||
if (id) {
|
if (id) {
|
||||||
const activeBrowser = browserPool.getRemoteBrowser(id);
|
// const activeBrowser = browserPool.getRemoteBrowser(id);
|
||||||
const currentPage = activeBrowser?.getCurrentPage();
|
// const currentPage = activeBrowser?.getCurrentPage();
|
||||||
if (decision) {
|
if (!decision) {
|
||||||
switch (actionType) {
|
switch (actionType) {
|
||||||
case 'customAction':
|
case 'customAction':
|
||||||
pair.where.selectors = [this.generatedData.lastUsedSelector];
|
// pair.where.selectors = [this.generatedData.lastUsedSelector];
|
||||||
|
pair.where.selectors = pair.where.selectors.filter(
|
||||||
|
(selector: string) => selector !== this.generatedData.lastUsedSelector
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (currentPage) {
|
// if (currentPage) {
|
||||||
await this.addPairToWorkflowAndNotifyClient(pair, currentPage);
|
// await this.addPairToWorkflowAndNotifyClient(pair, currentPage);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
socket.on('updatePair', (data) => {
|
socket.on('updatePair', (data) => {
|
||||||
@@ -360,6 +363,8 @@ export class WorkflowGenerator {
|
|||||||
}],
|
}],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await this.addPairToWorkflowAndNotifyClient(pair, page);
|
||||||
|
|
||||||
if (this.generatedData.lastUsedSelector) {
|
if (this.generatedData.lastUsedSelector) {
|
||||||
const elementInfo = await this.getLastUsedSelectorInfo(page, this.generatedData.lastUsedSelector);
|
const elementInfo = await this.getLastUsedSelectorInfo(page, this.generatedData.lastUsedSelector);
|
||||||
|
|
||||||
@@ -372,9 +377,7 @@ export class WorkflowGenerator {
|
|||||||
innerText: elementInfo.innerText,
|
innerText: elementInfo.innerText,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
}
|
||||||
await this.addPairToWorkflowAndNotifyClient(pair, page);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user