@mvegter/scrapedin 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +8 -5
- package/.github/dependabot.yml +0 -11
- package/logo.png +0 -0
- package/src/profile/profileScraperTemplate.js +0 -186
- package/src/profile/scrapAccomplishmentPanel.js +0 -11
- package/test/profile.test.js +0 -158
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mvegter/scrapedin",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "linkedin scraper updated for 2025+ website",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"linkedin",
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
"crawler"
|
|
9
9
|
],
|
|
10
10
|
"main": "src/scrapedin.js",
|
|
11
|
+
"files": [
|
|
12
|
+
"src"
|
|
13
|
+
],
|
|
11
14
|
"scripts": {
|
|
12
15
|
"lint": "standard --fix 'src/*.js'",
|
|
13
16
|
"test": "node --test test/"
|
|
@@ -22,14 +25,14 @@
|
|
|
22
25
|
"author": "Wagner Leonardi <leonardiwagner@gmail.com>",
|
|
23
26
|
"license": "Apache-2.0",
|
|
24
27
|
"dependencies": {
|
|
25
|
-
"puppeteer": "
|
|
26
|
-
"winston": "3.
|
|
28
|
+
"puppeteer": "25.19.0",
|
|
29
|
+
"winston": "3.19.0"
|
|
27
30
|
},
|
|
28
31
|
"devDependencies": {
|
|
29
|
-
"standard": "17.
|
|
32
|
+
"standard": "17.1.2"
|
|
30
33
|
},
|
|
31
34
|
"engines": {
|
|
32
|
-
"node": ">=
|
|
35
|
+
"node": ">= 22.12.0"
|
|
33
36
|
},
|
|
34
37
|
"homepage": "https://github.com/linkedtales/scrapedin#readme"
|
|
35
38
|
}
|
package/.github/dependabot.yml
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# To get started with Dependabot version updates, you'll need to specify which
|
|
2
|
-
# package ecosystems to update and where the package manifests are located.
|
|
3
|
-
# Please see the documentation for all configuration options:
|
|
4
|
-
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
|
5
|
-
|
|
6
|
-
version: 2
|
|
7
|
-
updates:
|
|
8
|
-
- package-ecosystem: "npm" # See documentation for possible values
|
|
9
|
-
directory: "/" # Location of package manifests
|
|
10
|
-
schedule:
|
|
11
|
-
interval: "daily"
|
package/logo.png
DELETED
|
Binary file
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
const template = {
|
|
2
|
-
profile: {
|
|
3
|
-
selector: '.scaffold-layout__main',
|
|
4
|
-
fields: {
|
|
5
|
-
name: '.text-heading-xlarge',
|
|
6
|
-
headline: '.text-body-medium',
|
|
7
|
-
location: '.text-body-small.inline.t-black--light.break-words',
|
|
8
|
-
connections: '.t-bold',
|
|
9
|
-
imageurl: {
|
|
10
|
-
selector: 'img.pv-top-card-profile-picture__image',
|
|
11
|
-
attribute: 'src'
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
about: {
|
|
16
|
-
selector: '#about ~ .display-flex .inline-show-more-text',
|
|
17
|
-
fields: {
|
|
18
|
-
text: 'span[aria-hidden="true"]'
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
positions: {
|
|
22
|
-
selector: '#experience ~ .pvs-list__outer-container .pvs-list > li.pvs-list__paged-list-item',
|
|
23
|
-
fields: {
|
|
24
|
-
title: '.mr1.hoverable-link-text.t-bold > span',
|
|
25
|
-
link: {
|
|
26
|
-
selector: 'a.optional-action-target-wrapper',
|
|
27
|
-
attribute: 'href'
|
|
28
|
-
},
|
|
29
|
-
url: {
|
|
30
|
-
selector: 'a.optional-action-target-wrapper',
|
|
31
|
-
attribute: 'href'
|
|
32
|
-
},
|
|
33
|
-
companyName: '.t-14.t-normal > span',
|
|
34
|
-
location: '.t-14.t-normal.t-black--light > span',
|
|
35
|
-
description: '.pvs-list__outer-container .inline-show-more-text span[aria-hidden="true"]',
|
|
36
|
-
date1: '.pvs-entity__caption-wrapper',
|
|
37
|
-
date2: '.pvs-entity__caption-wrapper',
|
|
38
|
-
roles: {
|
|
39
|
-
selector: '.pvs-entity__sub-components li.pvs-list__paged-list-item',
|
|
40
|
-
hasChildrenFields: true,
|
|
41
|
-
fields: {
|
|
42
|
-
title: '.mr1.hoverable-link-text.t-bold > span',
|
|
43
|
-
description: '.inline-show-more-text span[aria-hidden="true"]',
|
|
44
|
-
date: '.pvs-entity__caption-wrapper',
|
|
45
|
-
location: '.t-14.t-normal.t-black--light > span'
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
educations: {
|
|
51
|
-
selector: '#education ~ .pvs-list__outer-container .pvs-list > li.pvs-list__paged-list-item',
|
|
52
|
-
fields: {
|
|
53
|
-
title: '.hoverable-link-text.t-bold > span',
|
|
54
|
-
degree: '.t-14.t-normal > span',
|
|
55
|
-
url: {
|
|
56
|
-
selector: 'a',
|
|
57
|
-
attribute: 'href'
|
|
58
|
-
},
|
|
59
|
-
fieldOfStudy: '.t-14.t-normal > span',
|
|
60
|
-
date1: '.pvs-entity__caption-wrapper',
|
|
61
|
-
date2: '.pvs-entity__caption-wrapper',
|
|
62
|
-
description: '.inline-show-more-text span[aria-hidden="true"]'
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
skills: {
|
|
66
|
-
selector: '#skills ~ .pvs-list__outer-container .pvs-list > li.pvs-list__paged-list-item',
|
|
67
|
-
fields: {
|
|
68
|
-
title: '.mr1.hoverable-link-text.t-bold > span',
|
|
69
|
-
count: '.t-14.t-normal.t-black--light > span'
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
recommendationsCount: {
|
|
73
|
-
selector: '#recommendations ~ .pvs-list__outer-container',
|
|
74
|
-
fields: {
|
|
75
|
-
received: '.artdeco-tab:nth-child(1)',
|
|
76
|
-
given: '.artdeco-tab:nth-child(2)'
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
recommendationsReceived: {
|
|
80
|
-
selector: '#recommendations ~ .pvs-list__outer-container .pvs-list > li.pvs-list__paged-list-item',
|
|
81
|
-
fields: {
|
|
82
|
-
user: {
|
|
83
|
-
selector: 'a',
|
|
84
|
-
attribute: 'href'
|
|
85
|
-
},
|
|
86
|
-
text: '.inline-show-more-text span[aria-hidden="true"]',
|
|
87
|
-
profileImage: {
|
|
88
|
-
selector: 'img',
|
|
89
|
-
attribute: 'src'
|
|
90
|
-
},
|
|
91
|
-
name: {
|
|
92
|
-
selector: '.t-bold > span'
|
|
93
|
-
},
|
|
94
|
-
userDescription: {
|
|
95
|
-
selector: '.t-14.t-normal > span'
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
recommendationsGiven: {
|
|
100
|
-
selector: '#recommendations ~ .pvs-list__outer-container .pvs-list > li.pvs-list__paged-list-item',
|
|
101
|
-
fields: {
|
|
102
|
-
user: {
|
|
103
|
-
selector: 'a',
|
|
104
|
-
attribute: 'href'
|
|
105
|
-
},
|
|
106
|
-
text: '.inline-show-more-text span[aria-hidden="true"]',
|
|
107
|
-
profileImage: {
|
|
108
|
-
selector: 'img',
|
|
109
|
-
attribute: 'src'
|
|
110
|
-
},
|
|
111
|
-
name: {
|
|
112
|
-
selector: '.t-bold > span'
|
|
113
|
-
},
|
|
114
|
-
userDescription: {
|
|
115
|
-
selector: '.t-14.t-normal > span'
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
accomplishments: {
|
|
120
|
-
selector: '#honors_and_awards ~ .pvs-list__outer-container .pvs-list > li.pvs-list__paged-list-item',
|
|
121
|
-
fields: {
|
|
122
|
-
count: '.t-14.t-normal.t-black--light > span',
|
|
123
|
-
title: '.mr1.hoverable-link-text.t-bold > span',
|
|
124
|
-
items: {
|
|
125
|
-
selector: '.pvs-list__outer-container li',
|
|
126
|
-
isMultipleFields: true
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
peopleAlsoViewed: {
|
|
131
|
-
selector: '.pv-browsemap-section li',
|
|
132
|
-
fields: {
|
|
133
|
-
user: {
|
|
134
|
-
selector: 'a',
|
|
135
|
-
attribute: 'href'
|
|
136
|
-
},
|
|
137
|
-
text: '.t-14.t-normal',
|
|
138
|
-
profileImage: {
|
|
139
|
-
selector: 'img',
|
|
140
|
-
attribute: 'src'
|
|
141
|
-
},
|
|
142
|
-
name: {
|
|
143
|
-
selector: '.t-bold'
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
volunteerExperience: {
|
|
148
|
-
selector: '#volunteering_experience ~ .pvs-list__outer-container .pvs-list > li.pvs-list__paged-list-item',
|
|
149
|
-
fields: {
|
|
150
|
-
title: '.mr1.hoverable-link-text.t-bold > span',
|
|
151
|
-
experience: '.t-14.t-normal > span',
|
|
152
|
-
location: '.t-14.t-normal.t-black--light > span',
|
|
153
|
-
description: '.inline-show-more-text span[aria-hidden="true"]',
|
|
154
|
-
date1: '.pvs-entity__caption-wrapper',
|
|
155
|
-
date2: '.pvs-entity__caption-wrapper'
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
courses: {
|
|
159
|
-
selector: '#courses ~ .pvs-list__outer-container .pvs-list > li.pvs-list__paged-list-item',
|
|
160
|
-
fields: {
|
|
161
|
-
name: '.mr1.hoverable-link-text.t-bold > span',
|
|
162
|
-
year: '.t-14.t-normal > span'
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
languages: {
|
|
166
|
-
selector: '#languages ~ .pvs-list__outer-container .pvs-list > li.pvs-list__paged-list-item',
|
|
167
|
-
fields: {
|
|
168
|
-
name: '.mr1.t-bold > span',
|
|
169
|
-
proficiency: '.t-14.t-normal.t-black--light > span'
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
|
-
projects: {
|
|
173
|
-
selector: '#projects ~ .pvs-list__outer-container .pvs-list > li.pvs-list__paged-list-item',
|
|
174
|
-
fields: {
|
|
175
|
-
name: '.mr1.hoverable-link-text.t-bold > span',
|
|
176
|
-
date: '.pvs-entity__caption-wrapper',
|
|
177
|
-
description: '.inline-show-more-text span[aria-hidden="true"]',
|
|
178
|
-
link: {
|
|
179
|
-
selector: 'a',
|
|
180
|
-
attribute: 'href'
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
module.exports = template
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
const scrapSection = require('../scrapSection')
|
|
2
|
-
const template = require('./profileScraperTemplate')
|
|
3
|
-
|
|
4
|
-
const scrapAccomplishmentPanel = async (page, section) => {
|
|
5
|
-
if (!template[section]) {
|
|
6
|
-
return []
|
|
7
|
-
}
|
|
8
|
-
return scrapSection(page, template[section])
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
module.exports = scrapAccomplishmentPanel
|
package/test/profile.test.js
DELETED
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
const { test, before, after } = require('node:test')
|
|
2
|
-
const assert = require('node:assert/strict')
|
|
3
|
-
const puppeteer = require('puppeteer')
|
|
4
|
-
const { extractProfileData } = require('../src/profile/profile')
|
|
5
|
-
const scrollProfileCardsIntoView = require('../src/profile/scrollProfileCardsIntoView')
|
|
6
|
-
const seeMoreButtons = require('../src/profile/seeMoreButtons')
|
|
7
|
-
|
|
8
|
-
let browser
|
|
9
|
-
|
|
10
|
-
before(async () => { browser = await puppeteer.launch() })
|
|
11
|
-
after(async () => { await browser.close() })
|
|
12
|
-
|
|
13
|
-
const extractPositions = async (experienceHtml) => {
|
|
14
|
-
const page = await browser.newPage()
|
|
15
|
-
await page.setContent(`
|
|
16
|
-
<h1>Test Person</h1>
|
|
17
|
-
<section><h2>Experience</h2><div>${experienceHtml}</div></section>
|
|
18
|
-
`)
|
|
19
|
-
const { positions } = await extractProfileData(page)
|
|
20
|
-
await page.close()
|
|
21
|
-
return positions
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
test('single-role entry maps title, company, date and location', async () => {
|
|
25
|
-
const positions = await extractPositions(`
|
|
26
|
-
<div componentkey="entity-collection-1">
|
|
27
|
-
<a href="https://www.linkedin.com/company/12345/">
|
|
28
|
-
<p>Software Engineer</p>
|
|
29
|
-
<p>Acme Corp · Full-time</p>
|
|
30
|
-
<p>Jun 2026 - Present · 6 mos</p>
|
|
31
|
-
</a>
|
|
32
|
-
<p>Present</p>
|
|
33
|
-
<p>Springfield, Oregon, United States</p>
|
|
34
|
-
<div data-testid="expandable-text-box"><p>Building the platform.</p></div>
|
|
35
|
-
<p>Java and +3 skills</p>
|
|
36
|
-
</div>
|
|
37
|
-
`)
|
|
38
|
-
|
|
39
|
-
assert.deepEqual(positions, [{
|
|
40
|
-
title: 'Software Engineer',
|
|
41
|
-
companyName: 'Acme Corp',
|
|
42
|
-
link: 'https://www.linkedin.com/company/12345/',
|
|
43
|
-
url: 'https://www.linkedin.com/company/12345/',
|
|
44
|
-
location: 'Springfield, Oregon, United States',
|
|
45
|
-
description: 'Building the platform.',
|
|
46
|
-
date: 'Jun 2026 - Present',
|
|
47
|
-
date1: 'Jun 2026',
|
|
48
|
-
date2: 'Present'
|
|
49
|
-
}])
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
test('single-role entry without location leaves location empty', async () => {
|
|
53
|
-
const positions = await extractPositions(`
|
|
54
|
-
<div componentkey="entity-collection-1">
|
|
55
|
-
<p>Intern</p>
|
|
56
|
-
<p>Example BV</p>
|
|
57
|
-
<p>Feb 2019 - Jun 2019 · 5 mos</p>
|
|
58
|
-
<div data-testid="expandable-text-box"><p>Automation work.</p></div>
|
|
59
|
-
</div>
|
|
60
|
-
`)
|
|
61
|
-
|
|
62
|
-
assert.equal(positions[0].title, 'Intern')
|
|
63
|
-
assert.equal(positions[0].companyName, 'Example BV')
|
|
64
|
-
assert.equal(positions[0].date, 'Feb 2019 - Jun 2019')
|
|
65
|
-
assert.equal(positions[0].location, '')
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
test('top card is the section headed by the profile name', async () => {
|
|
69
|
-
const page = await browser.newPage()
|
|
70
|
-
await page.setContent(`
|
|
71
|
-
<title>Test Person | LinkedIn</title>
|
|
72
|
-
<section><h2>People you may know</h2>${'<p>Other Member</p><p>Engineer at Somewhere, Utrecht</p>'.repeat(10)}</section>
|
|
73
|
-
<section><h2>Test Person</h2><p>Software Engineer at Acme Corp</p><p>Springfield, Oregon, United States</p></section>
|
|
74
|
-
`)
|
|
75
|
-
const { profile } = await extractProfileData(page)
|
|
76
|
-
await page.close()
|
|
77
|
-
|
|
78
|
-
assert.equal(profile.name, 'Test Person')
|
|
79
|
-
assert.equal(profile.headline, 'Software Engineer at Acme Corp')
|
|
80
|
-
assert.equal(profile.location, 'Springfield, Oregon, United States')
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
test('profile cards rendered lazily inside an inner scroll container get loaded', async () => {
|
|
84
|
-
const page = await browser.newPage()
|
|
85
|
-
await page.setViewport({ width: 800, height: 600 })
|
|
86
|
-
await page.setContent(`
|
|
87
|
-
<style>html, body { margin: 0; height: 100%; overflow: hidden } main { height: 100%; overflow: auto }</style>
|
|
88
|
-
<main>
|
|
89
|
-
<div style="height: 5000px"></div>
|
|
90
|
-
<div id="profileCardsExperienceOnlytest"></div>
|
|
91
|
-
</main>
|
|
92
|
-
<script>
|
|
93
|
-
const card = document.getElementById('profileCardsExperienceOnlytest')
|
|
94
|
-
new IntersectionObserver(([entry]) => {
|
|
95
|
-
if (entry.isIntersecting) card.innerHTML = '<section><h2>Experience</h2></section>'
|
|
96
|
-
}).observe(card)
|
|
97
|
-
</script>
|
|
98
|
-
`)
|
|
99
|
-
await scrollProfileCardsIntoView(page)
|
|
100
|
-
const headings = await page.evaluate(() => [...document.querySelectorAll('section h2')].map(h => h.textContent))
|
|
101
|
-
await page.close()
|
|
102
|
-
|
|
103
|
-
assert.deepEqual(headings, ['Experience'])
|
|
104
|
-
})
|
|
105
|
-
|
|
106
|
-
test('show-more clicks stay inside profile cards and never open activity posts', async () => {
|
|
107
|
-
const page = await browser.newPage()
|
|
108
|
-
await page.setContent(`
|
|
109
|
-
<section><h2>Activity</h2>
|
|
110
|
-
<button data-testid="expandable-text-button" onclick="document.title = 'navigated to post'">more</button>
|
|
111
|
-
</section>
|
|
112
|
-
<div id="profileCardsExperienceOnlytest">
|
|
113
|
-
<section><h2>Experience</h2>
|
|
114
|
-
<button data-testid="expandable-text-button" onclick="this.textContent = 'expanded'">more</button>
|
|
115
|
-
</section>
|
|
116
|
-
</div>
|
|
117
|
-
`)
|
|
118
|
-
await seeMoreButtons.clickAll(page)
|
|
119
|
-
const result = await page.evaluate(() => ({
|
|
120
|
-
title: document.title,
|
|
121
|
-
experienceButton: document.querySelector('#profileCardsExperienceOnlytest button').textContent
|
|
122
|
-
}))
|
|
123
|
-
await page.close()
|
|
124
|
-
|
|
125
|
-
assert.deepEqual(result, { title: '', experienceButton: 'expanded' })
|
|
126
|
-
})
|
|
127
|
-
|
|
128
|
-
test('description keeps paragraph breaks', async () => {
|
|
129
|
-
const positions = await extractPositions(`
|
|
130
|
-
<div componentkey="entity-collection-1">
|
|
131
|
-
<p>Software Engineer</p>
|
|
132
|
-
<p>Acme Corp · Full-time</p>
|
|
133
|
-
<p>Jun 2026 - Present · 6 mos</p>
|
|
134
|
-
<p><span data-testid="expandable-text-box">First paragraph.<br><br>Second paragraph.</span></p>
|
|
135
|
-
</div>
|
|
136
|
-
`)
|
|
137
|
-
|
|
138
|
-
assert.equal(positions[0].description, 'First paragraph.\n\nSecond paragraph.')
|
|
139
|
-
})
|
|
140
|
-
|
|
141
|
-
test('project description is the text box after the project name', async () => {
|
|
142
|
-
const page = await browser.newPage()
|
|
143
|
-
await page.setContent(`
|
|
144
|
-
<h1>Test Person</h1>
|
|
145
|
-
<section><div><h2>Projects</h2></div><div>
|
|
146
|
-
<div>
|
|
147
|
-
<p><span data-testid="expandable-text-box">Example Project</span></p>
|
|
148
|
-
<p>Feb 2020 – Jun 2020</p>
|
|
149
|
-
<p><span data-testid="expandable-text-box">A project description.</span></p>
|
|
150
|
-
</div>
|
|
151
|
-
</div></section>
|
|
152
|
-
`)
|
|
153
|
-
const { projects } = await extractProfileData(page)
|
|
154
|
-
await page.close()
|
|
155
|
-
|
|
156
|
-
assert.equal(projects[0].name, 'Example Project')
|
|
157
|
-
assert.equal(projects[0].description, 'A project description.')
|
|
158
|
-
})
|