modif
This commit is contained in:
parent
0b3de762d8
commit
f7e1e618a4
2 changed files with 13 additions and 6 deletions
|
|
@ -91,7 +91,11 @@ const getUserProfile = async (req, res) => {
|
|||
}
|
||||
};
|
||||
|
||||
const scrapeLinkedInProfile = async (profileUrl) => {
|
||||
const scrapeLinkedInProfile = async (user) => {
|
||||
const img = user.img;
|
||||
const useremail = user.email;
|
||||
const profileUrl = user.linkedinUrl;
|
||||
|
||||
console.log("Scraping LinkedIn profile:", profileUrl);
|
||||
|
||||
const browser = await chromium.launch({
|
||||
|
|
@ -156,16 +160,19 @@ const scrapeLinkedInProfile = async (profileUrl) => {
|
|||
);
|
||||
|
||||
return {
|
||||
img: getText("img.pv-top-card-profile-picture__image--show"),
|
||||
img: user.img || null,
|
||||
email: user.email || null,
|
||||
linkedinUrl: user.linkedinUrl || null,
|
||||
|
||||
name: getText("h1"),
|
||||
headline: getText("div.text-body-medium.break-words"),
|
||||
location: getText(
|
||||
"span.text-body-small.inline.t-black--light.break-words"
|
||||
),
|
||||
// about: getText(""),
|
||||
// experiences: getAllText(
|
||||
// ""
|
||||
// ),
|
||||
experiences: getAllText(
|
||||
"div.KbuWagYZEALUPOYGtkFczhgTiHHNRLZKhdLlK > ul li"
|
||||
),
|
||||
// education: getAllText(""),
|
||||
// skills: getAllText(""),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ router.get("/me", async (req, res) => {
|
|||
`);
|
||||
}
|
||||
|
||||
const profile = await scrapeLinkedInProfile(user.linkedinUrl);
|
||||
const profile = await scrapeLinkedInProfile(user);
|
||||
|
||||
res.send(profile);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue