modfi
This commit is contained in:
parent
cb32993d5b
commit
1071ef012d
1 changed files with 6 additions and 1 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
const axios = require("axios");
|
const axios = require("axios");
|
||||||
const querystring = require("querystring");
|
const querystring = require("querystring");
|
||||||
import puppeteer from "puppeteer";
|
const puppeteer = require("puppeteer");
|
||||||
|
|
||||||
const clientId = "780w7gsy8eysmj";
|
const clientId = "780w7gsy8eysmj";
|
||||||
const clientSecret = "WPL_AP1.w6OTTkAndAdT3PYF.UZEcwQ==";
|
const clientSecret = "WPL_AP1.w6OTTkAndAdT3PYF.UZEcwQ==";
|
||||||
|
|
@ -92,14 +92,19 @@ const getUserProfile = async (req, res) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const scrapeLinkedInProfile = async (profileUrl) => {
|
const scrapeLinkedInProfile = async (profileUrl) => {
|
||||||
|
console.log("Scraping LinkedIn profile:", profileUrl);
|
||||||
const browser = await puppeteer.launch({ headless: false }); // headless: true si tu veux sans UI
|
const browser = await puppeteer.launch({ headless: false }); // headless: true si tu veux sans UI
|
||||||
const page = await browser.newPage();
|
const page = await browser.newPage();
|
||||||
|
|
||||||
|
console.log("Using email:", email);
|
||||||
|
|
||||||
// 1. Aller sur la page de login
|
// 1. Aller sur la page de login
|
||||||
await page.goto("https://www.linkedin.com/login", {
|
await page.goto("https://www.linkedin.com/login", {
|
||||||
waitUntil: "networkidle2",
|
waitUntil: "networkidle2",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log("Login page loaded");
|
||||||
|
|
||||||
// 2. Connexion avec identifiants
|
// 2. Connexion avec identifiants
|
||||||
await page.type("#username", email, { delay: 50 });
|
await page.type("#username", email, { delay: 50 });
|
||||||
await page.type("#password", password, { delay: 50 });
|
await page.type("#password", password, { delay: 50 });
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue