HARPA.AI
LIBRARYAPIGUIDESAI COMMANDSBLOG

💼  LinkedIn Profile Scraper

Scrapes all the available data from LinkedIn profiles, including contacts, education, experience etc.

Created by Priya Patel
Updated on Dec 28, 2024 18:39
Installed 109 times
RUNS JS CODE

How to Use

IMPORT COMMAND

Content

- type: group
  steps:
    - type: say
      message: ⚠️ Sorry, this doesn't seem to be a LinkedIn profile page.
    - type: stop
  condition:
    - '{{url}} =~ ^(?!https:\/\/www\.linkedin\.com\/in\/[\w\-]+\/?).*$'
- type: js
  args: ''
  code: |-
    const result = (() => {
        const selectors = {
            name: 'h1',
            status: '.text-body-medium.break-words',
            location: '.text-body-small.inline.t-black--light.break-words',
            contact: 'section.pv-top-card--website a',
            about: '#about ~ .display-flex span',
            experience: '#experience + div + div',
            education: '#education + div + div',
            language: '#languages + div + div'
        };

        const getListContent = (container) => {
            if (!container) return null
            return Array.from(container.querySelectorAll('.artdeco-list__item'))
                .map(item => {
                    const clone = item.cloneNode(true);
                    clone.querySelectorAll('.visually-hidden').forEach(el => el.remove());
                    return clone.textContent
                        .replace(/\s+/g, ' ')
                        .replace(/\n\n+/g, '\n')
                        .trim();
                });
        };

        const result = {
            name: document.querySelector(selectors.name)?.textContent.trim(),
            url: window.location.href,
            status: document.querySelector(selectors.status)?.textContent.trim(),
            location: document.querySelector(selectors.location)?.textContent.trim(),
            contact: document.querySelector(selectors.contact)?.href || null,
            about: document.querySelector(selectors.about)?.textContent.trim(),
            experience: getListContent(document.querySelector(selectors.experience)),
            education: getListContent(document.querySelector(selectors.education)),
            language: getListContent(document.querySelector(selectors.language))
        };

        return result;
    })();

    return result;
  param: profile
  timeout: 15000
- type: say
  message: |-
    JSON:

    {{profile}}
Notice: Please read before using

This automation command is created by a community member. HARPA AI team does not audit community commands.

Please review the command carefully and only install if you trust the creator.

Contact us
HomeUse CasesGuidesPrivacy PolicyTerms of Service
CAN WE STORE COOKIES?
Our website uses cookies for the purposes of accessibility and security. They also allow us to gather statistics in order to improve the website for you. More info: Privacy Policy