Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

advice to avoid CHALLENGE #392

Open
Eitol opened this issue May 9, 2024 · 3 comments
Open

advice to avoid CHALLENGE #392

Eitol opened this issue May 9, 2024 · 3 comments

Comments

@Eitol
Copy link

Eitol commented May 9, 2024

To prevent the challenge from being sent to me, I used Firefox cookies:

  • I logged in with Firefox
  • Then I extract the cookies with browser_cookie3
cookiejar_simple = browser_cookie3.firefox(domain_name='.linkedin.com')
cookiejar = requests.cookies.RequestsCookieJar()
for cookie in cookiejar_simple:
    cookiejar.set_cookie(cookie)        
api = Linkedin('', '', cookies=cookiejar)

I leave it to you as advice because it has helped me.

@selllikesybok
Copy link

Worked for me, thanks!

Important context for anyone else who may not realize: Chrome and possibly all Chromium browsers currently implement a difficult-to-circumvent (at least on Windows) lock on the cookies file. Firefox does not. You can go down a whole set of rabbit holes trying to figure that out, or just use a non-Chromium browser.

@yash85763
Copy link

@Eitol How did you extract the cookies, I am trying to find a way to extract cookies and not able to find it, I am using Firefox browser!

@cedibb
Copy link

cedibb commented Jun 20, 2024

@Eitol How did you extract the cookies, I am trying to find a way to extract cookies and not able to find it, I am using Firefox browser!

This is how I do it. Just paste into your browser's dev console:

function getLinkedinSessionCookie() {
  const cookieName = "JSESSIONID=";
  const cookies = document.cookie.split(";").map((cookie) => cookie.trim());

  const cookie = cookies.find((cookie) => cookie.startsWith(cookieName));

  if (!cookie) {
    return "";
  }

  const cookieValue = cookie.substring(cookieName.length);

  if (cookieValue.startsWith('"') && cookieValue.endsWith('"')) {
    return cookieValue.slice(1, -1);
  }

  return cookieValue;
}

getLinkedinSessionCookie()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants