Last active
May 7, 2019 12:17
-
-
Save martinferreira/3ae5848e904668a1fe71468670272a8f to your computer and use it in GitHub Desktop.
linkedincookies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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