Instagram jobs refactor + started InstagramNotifications
This commit is contained in:
@ -366,4 +366,16 @@ abstract class BrowserJob implements ShouldQueue
|
||||
AllNotification::send(new JobDebugNotification($this->jobId, $errorMessage));
|
||||
}
|
||||
}
|
||||
|
||||
public function clickElementWithJavaScript(Browser $browser, string $xPathSelector): void
|
||||
{
|
||||
$browser->script("
|
||||
var element = document.evaluate('{$xPathSelector}', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
|
||||
if (element) {
|
||||
element.click();
|
||||
} else {
|
||||
console.error('Element not found: {$xPathSelector}');
|
||||
}
|
||||
");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user