Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First job always fails #479

Open
Shuichi-code opened this issue Aug 2, 2022 · 2 comments
Open

First job always fails #479

Shuichi-code opened this issue Aug 2, 2022 · 2 comments

Comments

@Shuichi-code
Copy link

Hi,

Thanks to anyone who can help me with this, but whenever I run my script, the first job always fails to go to the target page.

image

The other jobs work fine enough.

I load the jobs based on the values inside a CSV file.

`const inputFilePath = 'PNPresetTemplateIds.csv';
const outputFilePath = 'done.csv';

try {
dataArray = fs.readFileSync(inputFilePath) //prod
//dataArray = fs.readFileSync('staging-ct-id.csv') //staging
.toString('UTF8')
.split(/\r?\n/);
} catch(e) {
console.log('Error:', e.stack);
}`

... //load the tasks from a file dataArray.forEach(presetTemplateId => { cluster.queue(presetTemplateId); });

is running a foreach on the dataArray a code smell?

Any help or information would be greatly appreciated. Thanks.

@tuana9a
Copy link

tuana9a commented Aug 8, 2022

As the error in the image tell, seem like the #wyswig-editor-preloader > div.no-margin.font-white element is not appear in less than 30s.

So maybe your job is to wait for this element, then re-check if its selector is correct or not

@Shuichi-code
Copy link
Author

Thanks for replying, but the element doesn't appear because puppeteer cluster can't seem to go to a different URL that has that element for the first job. But it can for subsequent jobs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants