@mvegter/scrapedin 1.0.29 → 1.0.30
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
CHANGED
|
@@ -2,13 +2,13 @@ const logger = require('../logger')(__filename)
|
|
|
2
2
|
const pkg = require('../package')
|
|
3
3
|
|
|
4
4
|
module.exports = (profile) => {
|
|
5
|
-
if(!profile
|
|
5
|
+
if(!profile?.profile?.name) {
|
|
6
6
|
const messageError = `LinkedIn website changed and ${pkg.name} ${pkg.version} can't read basic data. Please report this issue at ${pkg.bugs.url}`
|
|
7
7
|
logger.error(messageError, '')
|
|
8
8
|
throw new Error(messageError)
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
profile.profile.summary = profile
|
|
11
|
+
profile.profile.summary = profile?.about?.text
|
|
12
12
|
|
|
13
13
|
profile.positions.forEach((position) => {
|
|
14
14
|
if(position.title){
|
|
@@ -24,6 +24,11 @@ module.exports = (profile) => {
|
|
|
24
24
|
if(role.title) {
|
|
25
25
|
role.title = role.title.replace('Title\n', '')
|
|
26
26
|
}
|
|
27
|
+
if (role.date) {
|
|
28
|
+
role.date1 = role.date.replace('·', '-').split('-')[0].trim()
|
|
29
|
+
role.date2 = role.date.replace('·', '-').split('-')[1].trim()
|
|
30
|
+
delete role.date
|
|
31
|
+
}
|
|
27
32
|
if(role.description) {
|
|
28
33
|
role.description = role.description.replace('See more', '')
|
|
29
34
|
role.description = role.description.replace('see more', '')
|
|
@@ -21,7 +21,7 @@ const template = {
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
positions: {
|
|
24
|
-
selector: '
|
|
24
|
+
selector: 'section[id$="EXPERIENCE-en-US"] li.artdeco-list__item',
|
|
25
25
|
fields: {
|
|
26
26
|
title: 'h3',
|
|
27
27
|
link: {
|
|
@@ -32,7 +32,7 @@ const template = {
|
|
|
32
32
|
selector: 'a',
|
|
33
33
|
attribute: 'href'
|
|
34
34
|
},
|
|
35
|
-
companyName: '.
|
|
35
|
+
companyName: 'span.t-bold span',
|
|
36
36
|
location: '.pv-entity__location span:last-child',
|
|
37
37
|
description: '.pv-entity__description',
|
|
38
38
|
date1: '.pv-entity__date-range span:last-child',
|
|
@@ -41,10 +41,9 @@ const template = {
|
|
|
41
41
|
selector: 'li',
|
|
42
42
|
hasChildrenFields: true,
|
|
43
43
|
fields: {
|
|
44
|
-
title: '
|
|
44
|
+
title: 'span.t-bold span:last-child',
|
|
45
45
|
description: '.pv-entity__description',
|
|
46
|
-
|
|
47
|
-
date2: '.pv-entity__bullet-item-v2',
|
|
46
|
+
date: '.t-14.t-normal:last-child span:first-child',
|
|
48
47
|
location: '.pv-entity__location span:last-child'
|
|
49
48
|
}
|
|
50
49
|
}
|