diff --git a/controllers/linkedin.js b/controllers/linkedin.js index 1125ea7..db09c11 100644 --- a/controllers/linkedin.js +++ b/controllers/linkedin.js @@ -103,20 +103,24 @@ const scrapeLinkedInProfile = async (profileUrl) => { // 1. Login await page.goto("https://www.linkedin.com/login", { - waitUntil: "networkidle", + waitUntil: "domcontentloaded", + timeout: 60000, }); console.log("Login page loaded"); - await page.fill("#username", email); - await page.fill("#password", password); + await page.fill("#username", email, { delay: 50 }); + await page.fill("#password", password, { delay: 50 }); await Promise.all([ page.click('[type="submit"]'), - page.waitForNavigation({ waitUntil: "networkidle" }), + page.waitForNavigation({ waitUntil: "domcontentloaded", timeout: 60000 }), ]); console.log("Logged in"); // 2. Aller sur le profil - await page.goto(profileUrl, { waitUntil: "networkidle" }); + await page.goto(profileUrl, { + waitUntil: "domcontentloaded", + timeout: 60000, + }); // 3. Extraire infos const profileData = await page.evaluate(() => { diff --git a/package.json b/package.json index 9af2421..b505971 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "dotenv": "^8.2.0", "express": "^4.17.1", "express-session": "^1.17.1", - "puppeteer": "^24.19.0" + "playwright": "^1.55.0" }, "author": "ExostFlash", "license": "ISC",