|
@@ -37,7 +37,7 @@ class anafSPV(object):
|
|
|
self.session.mount('http://', adapter)
|
|
|
self.session.mount('https://', adapter)
|
|
|
|
|
|
- def get_cookies_from_browser(self):
|
|
|
+ def get_cookies_from_browser(self, window_title):
|
|
|
chrome_options = ChromeOptions()
|
|
|
chrome_options.add_argument('--disable-dev-shm-usage')
|
|
|
chrome_options.add_argument('--no-sandbox')
|
|
@@ -46,7 +46,7 @@ class anafSPV(object):
|
|
|
chrome_options.add_experimental_option('excludeSwitches', ['enable-automation'])
|
|
|
|
|
|
driver = webdriver.Chrome(options=chrome_options)
|
|
|
- thread = Thread(target=self.accept_cert, args=())
|
|
|
+ thread = Thread(target=self.accept_cert, args=(window_title))
|
|
|
thread.start()
|
|
|
driver.get(self.KEYURL)
|
|
|
self.cookies = driver.get_cookies()
|
|
@@ -56,7 +56,7 @@ class anafSPV(object):
|
|
|
self.requests_cookies[c['name']] = c['value']
|
|
|
return self.requests_cookies
|
|
|
|
|
|
- def accept_cert(self):
|
|
|
+ def accept_cert(self, window_title):
|
|
|
# brave_ready.wait()
|
|
|
sleep(2)
|
|
|
win_2 = gw.getWindowsWithTitle('data:,', condition=gw.Re.CONTAINS)[0]
|
|
@@ -67,7 +67,7 @@ class anafSPV(object):
|
|
|
try:
|
|
|
if t_ >= 1.5:
|
|
|
break
|
|
|
- win_ = gw.getWindowsWithTitle('Windows Security', condition=gw.Re.CONTAINS)[0]
|
|
|
+ win_ = gw.getWindowsWithTitle(window_title, condition=gw.Re.CONTAINS)[0]
|
|
|
if not win_.isActive:
|
|
|
win_.activate()
|
|
|
win_.acceptInput(True)
|