Skip to content

Commit dceaf00

Browse files
authored
replace requests.get with requests.Session().get
1 parent a147c45 commit dceaf00

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

GSDFA.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import time,datetime
1111
from tqdm import tqdm
1212

13+
sess = requests.Session()
14+
1315
#domainfinde function
1416
class GoogleSSLdomainFinder:
1517
def __init__(self,search_domain,show_expired):
@@ -28,12 +30,12 @@ def __init__(self,search_domain,show_expired):
2830

2931
def get_domain(self):
3032
if self.page_token != '':
31-
req = requests.get(self.nextUrl+self.page_token,headers=self.headers,verify=False)
33+
req = sess.get(self.nextUrl+self.page_token,headers=self.headers,verify=False)
3234
else:
3335
if self.show_expired == 'show':
34-
req = requests.get(self.indexUrl+'&domain='+self.search_domain+'&include_expired=true',headers=self.headers,verify=False)
36+
req = sess.get(self.indexUrl+'&domain='+self.search_domain+'&include_expired=true',headers=self.headers,verify=False)
3537
else:
36-
req = requests.get(self.indexUrl+'&domain='+self.search_domain,headers=self.headers,verify=False)
38+
req = sess.get(self.indexUrl+'&domain='+self.search_domain,headers=self.headers,verify=False)
3739
rep = (req.text).encode('utf-8').lstrip(")]}'")
3840
rep = re.sub(r'\[\[\"https\.ct\.cdsr\"\,','[',rep)
3941
rep = rep.replace('\n','').replace('\\','')

0 commit comments

Comments
 (0)