josephlimtech / linkedin-profile-scraper-api

🕵️‍♂️ LinkedIn profile scraper returning structured profile data in JSON.
MIT License
511 stars 142 forks source link

No target with given id found #18

Open karanrajpal14 opened 3 years ago

karanrajpal14 commented 3 years ago

Hello,

I am facing this weird issue where after fetching details for a few profiles, the script essentially fails. Here's what the error looks like.

Fetching data for https://www.linkedin.com/in/amiel-hussain-7a18159/
Scraper (close): Closing browser...
Scraper (close): Closed browser!
Scraper (close): Killing browser process pid: 614045...
Scraper (setup page): An error occurred during page setup.
Scraper (setup page): Protocol error (Target.attachToTarget): No target with given id found
Scraper (close): Closing browser...
Scraper (close): Closed browser!
Scraper (close): Killing browser process pid: 614045...
Scraper (run): An error occurred during a run.
Error: Protocol error (Target.attachToTarget): No target with given id found
    at /home/karan/projects/linkedin-profile-scraper-js/node_modules/puppeteer/lib/Connection.js:57:63
    at new Promise (<anonymous>)
    at Connection.send (/home/karan/projects/linkedin-profile-scraper-js/node_modules/puppeteer/lib/Connection.js:56:16)
    at Connection.createSession (/home/karan/projects/linkedin-profile-scraper-js/node_modules/puppeteer/lib/Connection.js:127:42)
    at Target._sessionFactory (/home/karan/projects/linkedin-profile-scraper-js/node_modules/puppeteer/lib/Browser.js:76:88)
    at Target.createCDPSession (/home/karan/projects/linkedin-profile-scraper-js/node_modules/puppeteer/lib/Target.js:54:21)
    at LinkedInProfileScraper.<anonymous> (/home/karan/projects/linkedin-profile-scraper-js/node_modules/linkedin-profile-scraper/dist/index.js:115:53)
    at Generator.next (<anonymous>)
    at fulfilled (/home/karan/projects/linkedin-profile-scraper-js/node_modules/tslib/tslib.js:111:62)
    at runMicrotasks (<anonymous>) {
  message: 'Protocol error (Target.attachToTarget): No target with given id found'
}
Error in setting data TypeError: Cannot read property 'userProfile' of undefined
    at generateEmail (/home/karan/projects/linkedin-profile-scraper-js/index.js:33:26)
    at /home/karan/projects/linkedin-profile-scraper-js/index.js:84:24

Any ideas on why this is happening?

jvandenaardweg commented 3 years ago

Hi @karanrajpal14 , thanks for reporting. What version are you using?

I've just tried it with the latest version, and I don't see the problem happening there.

karanrajpal14 commented 3 years ago

Hello @jvandenaardweg, thank you for the response! I am on the latest version currently, i.e. v2.3.1 and this seems to be happening very often.

One thing that I forgot to mention is that this usually happens after going through about 15 profiles. For example, the error above occurred after the 17th profile or so. Is that intended? I am using a recruiter account so I certainly shouldn't have such a low limit on the number of profiles I can go through.

Are there any other logs I can provide that will help you narrow down on the issue perhaps?