modif
This commit is contained in:
parent
07a0052624
commit
01d79c06da
1 changed files with 22 additions and 0 deletions
|
|
@ -116,12 +116,34 @@ const scrapeLinkedInProfile = async (profileUrl) => {
|
||||||
]);
|
]);
|
||||||
console.log("Logged in");
|
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
|
// 2. Aller sur le profil
|
||||||
await page.goto(profileUrl, {
|
await page.goto(profileUrl, {
|
||||||
waitUntil: "domcontentloaded",
|
waitUntil: "domcontentloaded",
|
||||||
timeout: 60000,
|
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
|
// 3. Extraire infos
|
||||||
const profileData = await page.evaluate(() => {
|
const profileData = await page.evaluate(() => {
|
||||||
const getText = (selector) =>
|
const getText = (selector) =>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue