我正在尝试使用此库抓取 LinkedIn 个人资料: https://www.npmjs.com/package/@nhn/linkedin-profile-scraper。这是我的代码:
<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>
Run Code Online (Sandbox Code Playgroud)
我正在使用 sveltekit 来获取信息,有人可以指出如何解决这个问题,我在网上找不到太多信息。