import re
def parseCookieFile() -> dict:
''' parseCookieFile function used to convert
NetScape cookies file into a dictionary '''
cookies = {}
with open (COOKIES_FILE, 'r') as file:
for line in file:
if not re.match(r'^\#', line):
lineFields = line.strip().split('\t')
cookies[lineFields[5]] = lineFields[6]
return cookies
Created
June 27, 2022 22:44
-
-
Save h3ssan/28196d1b4361b96b9358e844e5bb5cf0 to your computer and use it in GitHub Desktop.
Convert netscape cookies to use in python 3 requests library
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment