modif
This commit is contained in:
parent
9d6d51451b
commit
07a0052624
2 changed files with 10 additions and 6 deletions
|
|
@ -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(() => {
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue