Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
serefyarar committed May 25, 2024
1 parent a3debe3 commit 1e524a8
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@ const initializeCrawler = async () => {
requestHandler: async ({ request, page }) => {
await page.waitForNetworkIdle();

await Promise.all([
page
.evaluate(() => window.scrollBy(0, window.innerHeight))
.then(() => page.waitForTimeout(152)),
page
.evaluate(() => window.scrollBy(0, window.innerHeight))
.then(() => page.waitForTimeout(204)),
]);
await page.evaluate(() => {
return window.scrollBy(0, window.innerHeight);
});
await sleep(152);

await page.evaluate(() => {
return window.scrollBy(0, window.innerHeight);
});

await sleep(263);

const content = await page.content();
console.log(`Title: ${await page.title()}`);
Expand Down

0 comments on commit 1e524a8

Please sign in to comment.