I am trying to scrape LinkedIn profile using this library: https://www.npmjs.com/package/@n-h-n/linkedin-profile-scraper. This is my code:
<script>
import { LinkedInProfileScraper } from '@matidiaz/linkedin-profile-scraper';
import { onMount } from 'svelte';
import { session } from '$app/stores';
onMount(async () => {
const token = session?.provider_token;
console.log(token);
const scraper = new LinkedInProfileScraper({
sessionCookieValue: token,
keepAlive: false
});
// Prepare the scraper
// Loading it in memory
await scraper.setup();
const result = await scraper.run('https://www.linkedin.com/in/jvandenaardweg/');
console.log(result);
});
</script>
I am using sveltekit to get the information, can someone point out how to solve this problem, I am not finding much information online.
vite.config.ts
defineConfig({ resolve: { alias: { util: "util/" } } });
. – Parsley