Linkedin post reactions scraper avatar
Linkedin post reactions scraper
Try for free

3 days trial then $13.00/month - No credit card required now

View all Actors
Linkedin post reactions scraper

Linkedin post reactions scraper

curious_coder/linkedin-post-reactions-scraper
Try for free

3 days trial then $13.00/month - No credit card required now

Scrape reactions or likes from linkedin post

OC

`TypeError` in `linkedin.js`: Unable to Read Null Property

Closed

orchid_clamp opened this issue
a year ago

An error occurs in linkedin.js at line 40 when attempting to access matches[1] from a null matches object, leading to a TypeError. The error is observed during the page fetch process in the Docker container. It suggests potential issues with regex matching or parsing within the related methods. The system runs on Apify version 3.1.5, Node version v16.20.1, and Linux OS.

curious_coder avatar

Glad you reported this issue. Fix has been done.

OC

orchid_clamp

a year ago

You sure? Still get the same error:

2023-09-06T13:14:13.015Z ACTOR: Pulling Docker image from repository. 2023-09-06T13:14:14.028Z ACTOR: Creating Docker container. 2023-09-06T13:14:14.172Z ACTOR: Starting Docker container. 2023-09-06T13:14:16.260Z INFO System info {"apifyVersion":"3.1.5","apifyClientVersion":"2.7.1","crawleeVersion":"3.3.3","osType":"Linux","nodeVersion":"v16.20.2"} 2023-09-06T13:14:16.574Z INFO Fetching page 0 2023-09-06T13:14:16.728Z file:///usr/src/app/src/linkedin.js:44 2023-09-06T13:14:16.730Z return body.elements[0] 2023-09-06T13:14:16.733Z ^ 2023-09-06T13:14:16.736Z 2023-09-06T13:14:16.738Z TypeError: Cannot read properties of undefined (reading '0') 2023-09-06T13:14:16.742Z at Client.getPostByUrl (file:///usr/src/app/src/linkedin.js:44:24) 2023-09-06T13:14:16.745Z at processTicksAndRejections (node:internal/process/task_queues:96:5) 2023-09-06T13:14:16.748Z at async Client.getActivityIdFromPostUrl (file:///usr/src/app/src/linkedin.js:29:23) 2023-09-06T13:14:16.750Z at async file:///usr/src/app/src/main.js:17:18

curious_coder avatar

I checked again with exact input you have used in the run you have shared. I got an error, but it was different than one you have shared in last message, but i fixed it and pushed another update.

Did you try with a different URL ? if yes, give me the new URL

OC

orchid_clamp

a year ago

Hi! So I am running it with thus URL:

https://www.linkedin.com/feed/update/urn:li:activity:7104750023355047937/

Receiving these logs:

2023-09-07T08:46:50.305Z ACTOR: Pulling Docker image from repository. 2023-09-07T08:46:51.566Z ACTOR: Creating Docker container. 2023-09-07T08:46:51.974Z ACTOR: Starting Docker container. 2023-09-07T08:46:53.699Z INFO System info {"apifyVersion":"3.1.5","apifyClientVersion":"2.7.1","crawleeVersion":"3.3.3","osType":"Linux","nodeVersion":"v16.20.2"} 2023-09-07T08:46:53.808Z INFO Fetching page 1 2023-09-07T08:46:54.454Z file:///usr/src/app/src/linkedin.js:79 2023-09-07T08:46:54.457Z connectionType: item.reactorLockup.label.text, 2023-09-07T08:46:54.459Z ^ 2023-09-07T08:46:54.463Z 2023-09-07T08:46:54.466Z TypeError: Cannot read properties of undefined (reading 'text') 2023-09-07T08:46:54.468Z at file:///usr/src/app/src/linkedin.js:79:58 2023-09-07T08:46:54.471Z at Array.map (

I also ran it with this URL: https://www.linkedin.com/posts/edhec-augmented-law-institute_accord-g7-que-pensez-dun-imp%C3%B4t-minimum-activity-6807702379925000192-WWeV/

and got these logs: 2023-09-07T08:48:23.654Z ACTOR: Pulling Docker image from repository. 2023-09-07T08:48:24.745Z ACTOR: Creating Docker container. 2023-09-07T08:48:24.923Z ACTOR: Starting Docker container. 2023-09-07T08:48:27.306Z INFO System info {"apifyVersion":"3.1.5","apifyClientVersion":"2.7.1","crawleeVersion":"3.3.3","osType":"Linux","nodeVersion":"v16.20.2"} 2023-09-07T08:48:27.512Z INFO Fetching page 1 2023-09-07T08:48:27.647Z file:///usr/src/app/src/linkedin.js:44 2023-09-07T08:48:27.649Z return body.elements[0] 2023-09-07T08:48:27.651Z ^ 2023-09-07T08:48:27.653Z 2023-09-07T08:48:27.655Z TypeError: Cannot read properties of undefined (reading '0') 2023-09-07T08:48:27.657Z at Client.getPostByUrl (file:///usr/src/app/src/linkedin.js:44:24) 2023-09-07T08:48:27.659Z at processTicksAndRejections (node:internal/process/task_queues:96:5) 2023-09-07T08:48:27.661Z at async Client.getActivityIdFromPostUrl (file:///usr/src/app/src/linkedin.js:29:23) 2023-09-07T08:48:27.663Z at async file:///usr/src/app/src/main.js:17:18

curious_coder avatar

Done. Both are fixed in build 1.0.7

OC

orchid_clamp

a year ago

Like a charm, thanks a lot!

Developer
Maintained by Community
Actor metrics
  • 34 monthly users
  • 1 star
  • 84.4% runs succeeded
  • 19 hours response time
  • Created in Jul 2023
  • Modified 4 days ago
Categories