Skip to content

Documentation

Wagner Leonardi edited this page Dec 11, 2019 · 3 revisions

- options Object:

options object is the parameter for the scrapedin function, which contains the following properties:

  • Login via LinkedIn user credentials (required if you aren't going to use cookies)
name type description
email String login email
password String login password

example:

const options = { 
  email: 'some@email.com',
  password: 'some.password'
}
  • Use cookies as the credential (required if you aren't going to use email and password)
name type description
cookies Array[Object] credential cookies

example:

const options = { 
  cookies: [
    { "domain": ".linkedin", "name": "_ga", "value": "GA1.2.45454543" },
    { "domain": ".linkedin.com", "name": "aam_uuid", "value": "654891541684" },
    ...
  ]
}
  • Debug options (all optional)
name type description
hasToLog boolean prints scrapedin logs on stdout (default: false)
isHeadless boolean displays browser scrapping actions (default: false)
puppeteerArgs Array[String] puppeteer launch options Object. It's very useful, you can also pass Chromium parameters at its args property. (default: { args: ['--no-sandbox']})
  • Collect contact info (optional)
name type description
hasToGetContactInfo boolean collect profile contact information (default: false)

Example: scrapedin({ hasToGetContactInfo: true })

- scrapedin(options) Function

Receive options as parameter and returns a Promise of profileScraper

example using async/await:

async function yourFunction(){
  const options = {...}
  const profileScraper = await scrapedin(options)
  const profile = await profileScraper('https://www.linkedin.com/in/some-profile/')
}

example using promises:

const options = {...}
scrapedin(options)
.then((profileScraper) => profileScraper('https://www.linkedin.com/in/some-profile/'))
.then((profile) => console.log(profile))

- profileScraper(url, waitTimeMs = 500) Function

Receives a url parameter which will be the scraped LinkedIn URL and waitTimeMs which is the milliseconds which scrapper should wait to LinkedIn load all contents to be scraped.

Returns a Promise of profile object.

- profile Object

It's the contents of scraped profile in the following structure:

  {
    profile: {
      name, headline, location, summary, connections, followers
    },
    positions:[
      { title, company, description, date1, date2,
        roles: [{ title, description, date1, date2 }]
      }
    ],
    educations: [
      { title, degree, date1, date2 }
    ],
    skills: [
      { title, count }
    ],
    recommendations: [
      { user, text }
    ],
    recommendationsCount: {
      received, given
    },
    recommendationsReceived: [
      { user, text }
    ],
    recommendationsGiven: [
      { user, text }
    ],
    accomplishments: [
     { count, title, items }
    ],
    volunteerExperience: {
      title, experience, location, description, date1, date2
    },
    peopleAlsoViewed: [
      { user, text }
    ]
  }