You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is posible your cookie credentials become invalid and LinkedIn redirects to the "authwall" where you need to login again.
The current code simple returns an empty profile object that generates an error like Cannot read property 'name' of undefined at module.exports (xxx/node_modules/scrapedin/src/profile/cleanProfileData.js:5:23)
At least for me, in that cases, it's necessary to know if the profile has failed due auth error and because of this I have modified slightly the profile.js file with the next lines:
module.exports=async(browser,cookies,url,waitTimeToScrapMs=500,hasToGetContactInfo=false,puppeteerAuthenticate=undefined)=>{
...
constpage=awaitopenPage({ browser, cookies, url, puppeteerAuthenticate })letauthwall=false;page.on('response',response=>{conststatus=response.status()if((status>=300)&&(status<=399)){constlocation=response.headers()['location'];if(location.includes('authwall')){authwall=true;}}})constprofilePageIndicatorSelector='.pv-profile-section'awaitpage.waitFor(profilePageIndicatorSelector,{timeout: 5000}).catch(()=>{//why doesn't throw error instead of continuing scraping?//because it can be just a false negative meaning LinkedIn only changed that selector but everything else is fine :)logger.warn('profile selector was not found')})// If redirect to authwall is detected throw errorif(authwall){constmsg='Redirected to authwall :( You need new credentials';logger.warn(msg);thrownewError(msg);}
...
I don't know if this is something you want to integrate in the project. If so, let me know and I will send a PR.
Thanks in advance.
The text was updated successfully, but these errors were encountered:
send a PR for sure, I'm very busy realocating right now, however there are more people to review and approve it, once that's done I'll just publish the npm package.
It is posible your cookie credentials become invalid and LinkedIn redirects to the "authwall" where you need to login again.
The current code simple returns an empty profile object that generates an error like
Cannot read property 'name' of undefined at module.exports (xxx/node_modules/scrapedin/src/profile/cleanProfileData.js:5:23)
At least for me, in that cases, it's necessary to know if the profile has failed due auth error and because of this I have modified slightly the
profile.js
file with the next lines:I don't know if this is something you want to integrate in the project. If so, let me know and I will send a PR.
Thanks in advance.
The text was updated successfully, but these errors were encountered: