ScrapedIn icon indicating copy to clipboard operation
ScrapedIn copied to clipboard

[Fatal] Could not authenticate to linkedin. Set credentials in your environment variables.

Open 0xCGonzalo opened this issue 2 years ago • 3 comments

Hello,

I have configured the credentials in the configuration file and in the environment variables:

cat config.py~:

...
linkedin = dict(
    username = '[email protected]',
    password = '#ExamplePwd123!'
)
...

export LI_USERNAME={[email protected]} export LI_PASSWORD={#ExamplePwd123!}

and

export [email protected] export LI_PASSWORD=#ExamplePwd123!

I keep getting the same validation error.

Is the correct endpoint yet?

0xCGonzalo avatar Dec 17 '23 07:12 0xCGonzalo

I was running into this too, so I enabled HTTP request logging by adding the following to ScrapedIn.py:

import http

http.client.HTTPConnection.debuglevel = 1

When I ran the script, it showed I was being redirected to a /checkpoint/challenge/ URL -- i.e., LinkedIn found the script's login attempt suspicious.

You can get around this by authenticating via your browser, obtaining the li_at cookie value, then changing line 338 to:

cookies = { 'li_at': 'yourHugeSessionTokenThatYouGotFromYourBrowserGoesHere' }

I've need to massage a few other lines to get the actual search/parsing working, but that should at least handle auth for you.

pmarrapese avatar Feb 16 '24 02:02 pmarrapese

@pmarrapese thank you!

0xCGonzalo avatar Feb 16 '24 03:02 0xCGonzalo

Hi @pmarrapese i dont understand yet at

import http http.client.HTTPConnection.debuglevel = 1 /checkpoint/challenge/ li_at cookies = { 'li_at': 'yourHugeSessionTokenThatYouGotFromYourBrowserGoesHere' }

Could you explain it step by step or in a video? Thanks!

jaaaare avatar Mar 01 '24 06:03 jaaaare