Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save martinferreira/3ae5848e904668a1fe71468670272a8f to your computer and use it in GitHub Desktop.
Save martinferreira/3ae5848e904668a1fe71468670272a8f to your computer and use it in GitHub Desktop.
linkedincookies
COOKIE_FILE = "linkedinheader.txt";
import browser_cookie3;
import requests;
cj = browser_cookie3.load(domain_name='www.linkedin.com');
r = requests.get("http://www.linkedin.com", cookies=cj)
f= open(COOKIE_FILE,"w+")
link="https://www.linkedin.com/voyager/api/messaging/conversations?keyVersion=LEGACY_INBOX&count=20"
str = "cookie:"
key = ""
for cookie in cj:
str += cookie.name + "=" + cookie.value + "; "
if (cookie.name =="JSESSIONID"):
key = cookie.value
str= str[0:len(str)-1];
str += "\n"
str += "csrf-token:" + key.replace("\"","")
f.write(str)
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment