From 01d79c06dafe96a927424a5b7a98ee09e650be0a Mon Sep 17 00:00:00 2001 From: AMAICDAX Date: Tue, 9 Sep 2025 16:35:28 +0200 Subject: [PATCH] modif --- controllers/linkedin.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/controllers/linkedin.js b/controllers/linkedin.js index db09c11..0d21074 100644 --- a/controllers/linkedin.js +++ b/controllers/linkedin.js @@ -116,12 +116,34 @@ const scrapeLinkedInProfile = async (profileUrl) => { ]); console.log("Logged in"); + // Aller sur le profil et attendre le contenu + await page.goto(profileUrl, { + waitUntil: "domcontentloaded", + timeout: 60000, + }); + await page.waitForSelector("h1", { timeout: 60000 }); + + // Scroll pour charger lazy sections + await page.evaluate(() => window.scrollBy(0, window.innerHeight)); + await page.waitForTimeout(2000); + // 2. Aller sur le profil await page.goto(profileUrl, { waitUntil: "domcontentloaded", timeout: 60000, }); + // Aller sur le profil et attendre le contenu + await page.goto(profileUrl, { + waitUntil: "domcontentloaded", + timeout: 60000, + }); + await page.waitForSelector("h1", { timeout: 60000 }); + + // Scroll pour charger lazy sections + await page.evaluate(() => window.scrollBy(0, window.innerHeight)); + await page.waitForTimeout(2000); + // 3. Extraire infos const profileData = await page.evaluate(() => { const getText = (selector) =>