prevent SyntaxError: Identifier 'targetEl' has already been declared

This commit is contained in:
bossgeekgo
2024-02-10 09:30:29 +08:00
parent 64db06a5d2
commit d05844fa54

View File

@@ -146,7 +146,7 @@ async function mainLoop () {
if (targetJobIndex > 0) {
// scroll that target element into view
await page.evaluate(`
const targetEl = document.querySelector("ul.rec-job-list").children[${targetJobIndex}]
targetEl = document.querySelector("ul.rec-job-list").children[${targetJobIndex}]
targetEl.scrollIntoView({
behavior: 'smooth',
block: ${Math.random() > 0.5 ? '\'center\'' : '\'end\''}