Skip to content
This repository was archived by the owner on Jan 19, 2021. It is now read-only.

Conversation

@dietbald
Copy link

No description provided.

try {
(async () => {
const browser = await puppeteer.launch()
const browser = await puppeteer.launch({ headless: false})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to have { headless: true } here

await page.type('#twotabsearchtextbox', 'nyan cat pullover')
await page.click('input.nav-input')
await page.waitForSelector('#resultsCol')
await page.waitFor(3000);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an anti-pattern. waitFor(3000) or any wait period that does not wait for an explicit element is bound to break. Please wait for a specific element.

await page.click('#pagnNextString')
await page.waitForSelector('#resultsCol')
await page.click('li[class="a-last"] > a')
await page.waitFor(3000);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment on waitFor() above.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants