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
|
// 1. Login
|
||||||
await page.goto("https://www.linkedin.com/login", {
|
await page.goto("https://www.linkedin.com/login", {
|
||||||
waitUntil: "networkidle",
|
waitUntil: "domcontentloaded",
|
||||||
|
timeout: 60000,
|
||||||
});
|
});
|
||||||
console.log("Login page loaded");
|
console.log("Login page loaded");
|
||||||
|
|
||||||
await page.fill("#username", email);
|
await page.fill("#username", email, { delay: 50 });
|
||||||
await page.fill("#password", password);
|
await page.fill("#password", password, { delay: 50 });
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
page.click('[type="submit"]'),
|
page.click('[type="submit"]'),
|
||||||
page.waitForNavigation({ waitUntil: "networkidle" }),
|
page.waitForNavigation({ waitUntil: "domcontentloaded", timeout: 60000 }),
|
||||||
]);
|
]);
|
||||||
console.log("Logged in");
|
console.log("Logged in");
|
||||||
|
|
||||||
// 2. Aller sur le profil
|
// 2. Aller sur le profil
|
||||||
await page.goto(profileUrl, { waitUntil: "networkidle" });
|
await page.goto(profileUrl, {
|
||||||
|
waitUntil: "domcontentloaded",
|
||||||
|
timeout: 60000,
|
||||||
|
});
|
||||||
|
|
||||||
// 3. Extraire infos
|
// 3. Extraire infos
|
||||||
const profileData = await page.evaluate(() => {
|
const profileData = await page.evaluate(() => {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
"dotenv": "^8.2.0",
|
"dotenv": "^8.2.0",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"express-session": "^1.17.1",
|
"express-session": "^1.17.1",
|
||||||
"puppeteer": "^24.19.0"
|
"playwright": "^1.55.0"
|
||||||
},
|
},
|
||||||
"author": "ExostFlash",
|
"author": "ExostFlash",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue