Closed Shahzad6077 closed 4 years ago
Thanks for reporting! This is now fixed in master
Changes: https://github.com/jvandenaardweg/linkedin-profile-scraper/pull/5
Hi everyone!
I'm facing a similar issue and I did check I've got the latest versions from the selectors you pushed in #5 ✔️ .
Judging by the logs, it seems that some "View more" buttons are being missed, given tough that such selectors are correct (manually checked them in a Browser)
export const RequestLinkedin = async ({ language }) => {
try {
const scraper = new LinkedInProfileScraper({
sessionCookieValue: process.env.LI_AT_COOKIE_VALUE,
keepAlive: process.env.NODE_ENV === 'development',
});
// Prepare the scraper
// Loading it in memory
await scraper.setup();
const url = getURL({ language });
const result = await scraper.run(url);
return result;
} catch (err) {
if (err.name === 'SessionExpired') {
// Do something when the scraper notifies you it's not logged-in anymore
throw new Error('SessionExpired');
}
return;
}
};
For example...
the problem likely starts around line 195, and is exhibited by inspecting the value of
userProfile
variable.