Linkedin post scraper avatar

Linkedin post scraper

Try for free

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

View all Actors
Linkedin post scraper

Linkedin post scraper

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

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

Scrape linkedin posts or updates from linkedin post search results. Supports advanced linkedin search filters. Extract posts from any linkedin member

CS

Cookie Editor Chrome Extension vs Puppeteer Cookies

Closed

chinobi_seven opened this issue
21 days ago

Hi, I am currently working on using the post scraper programmatically in nodejs. In order to get cookie data, I am using Puppeteer to login into Linkedin and save my cookie data that is later converted into JSON. When I use that cookie data in my input, I am met with the following error:

"There was an uncaught exception during the run of the Actor and it was not handled."

However, when I use the Cookie Editor manually it works fine. When comparing both cookie outputs. I notice slight differences. Is there a specific format that the cookies need to be in in order for this to work?

curious_coder avatar

Yes there are some differences in cookie format between puppeteer and cookie-editor extension. For example, field name should be renamed to key when converting from puppeteer cookie. You can compare a sample cookie and make necessary changes

CS

chinobi_seven

20 days ago

Hi, I have worked to re-format what i am getting from Puppeteer and I am very stuck. I am getting the following error:

2024-11-01T19:33:06.317Z TypeError: Cannot read properties of undefined (reading 'startsWith') 2024-11-01T19:33:06.319Z at isSecurePrefixConditionMet (/usr/src/app/node_modules/tough-cookie/lib/cookie.js:650:22) 2024-11-01T19:33:06.321Z at CookieJar.setCookie (/usr/src/app/node_modules/tough-cookie/lib/cookie.js:1255:12) 2024-11-01T19:33:06.324Z at CookieJar.setCookie (/usr/src/app/node_modules/tough-cookie/node_modules/universalify/index.js:5:67) 2024-11-01T19:33:06.326Z at CookieJar.setCookieSync (/usr/src/app/node_modules/tough-cookie/lib/cookie.js:1728:17) 2024-11-01T19:33:06.328Z at file:///usr/src/app/src/helpers.js:54:9 2024-11-01T19:33:06.330Z at Array.forEach () 2024-11-01T19:33:06.332Z at Object.updateCookieJar (file:///usr/src/app/src/helpers.js:51:11) 2024-11-01T19:33:06.334Z at new Client (file:///usr/src/app/src/linkedin.js:20:21) 2024-11-01T19:33:06.337Z at file:///usr/src/app/src/main.js:79:16 2024-11-01T19:33:06.339Z at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Based on the following cookie format:

[ { "key": "__cf_bm", "value": "...", "domain": ".linkedin.com", "path": "/", "expires": 1730487049.232516, "secure": true, "httpOnly": true

1},
2{
3  "key": "lidc",
4  "value": "...",

... [trimmed]

curious_coder avatar

Sorry, it was my mistake, My previous advice was wrong.

Actual mistake is you've passed the cookies as array of stringified json cookies.

You should not stringify the individual cookie object inside arrays. Instead pass the cookie array as object of arrays and stringify the entire input the actor as JSON

Developer
Maintained by Community

Actor Metrics

  • 479 monthly users

  • 79 stars

  • 93% runs succeeded

  • 4.5 days response time

  • Created in Jun 2023

  • Modified 24 days ago