-
Notifications
You must be signed in to change notification settings - Fork 0
/
cookieHandler.py
58 lines (37 loc) · 1.29 KB
/
cookieHandler.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from driverHandler import *
import pickle
import time
import pandas as pd
import re
#import speedtest-cli
#PASWORD DONT DELETE!! )Uid,+-RB,z56Xf
page_link='https://www.linkedin.com/in/thomas-reck/recent-activity/shares/'
#https://www.linkedin.com/in/patrice-louvet/recent-activity/shares/
cookie_save_name='cookieJar/insight_google_account.pkl'
def checkProxy():
driver.get('https://dnsleaktest.com/')
time.sleep(50)
def getCookies():
driver.get(page_link)
time.sleep(100)
pickle.dump( driver.get_cookies() , open(cookie_save_name,"wb"))
driver.quit()
def injectCookies(cookieList='cookieJar/insight_google_account.pkl'):
driver.get('https://www.linkedin.com/feed/')
with open(cookieList, 'rb') as f:
cookies = pickle.load(f)
for cookie in cookies:
# adding the cookies to the session through webdriver instance
# cookie.pop('domain',None)
if cookie['name'] == "fcookie":
print("\__!!! fcookie found !!!")
continue
if cookie['name'] == 'bcookie':
#print("bcookie found",'og: "v=2&f3897221-234a-4efd-896e-cb24a9edaca7" ')
continue
driver.add_cookie(cookie)
print('\__Cookies injected successfully')
time.sleep(2)
#getCookies()
#injectCookies(page_link,cookie_save_name)
#checkProxy()