seleniumUts 1.2.2__tar.gz → 1.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {seleniumuts-1.2.2 → seleniumuts-1.2.4}/PKG-INFO +1 -1
- {seleniumuts-1.2.2 → seleniumuts-1.2.4}/seleniumUts/seleniumuts.py +9 -1
- {seleniumuts-1.2.2 → seleniumuts-1.2.4}/seleniumUts/webelement.py +1 -1
- {seleniumuts-1.2.2 → seleniumuts-1.2.4}/seleniumUts.egg-info/PKG-INFO +1 -1
- {seleniumuts-1.2.2 → seleniumuts-1.2.4}/setup.py +1 -1
- {seleniumuts-1.2.2 → seleniumuts-1.2.4}/README.md +0 -0
- {seleniumuts-1.2.2 → seleniumuts-1.2.4}/seleniumUts/__init__.py +0 -0
- {seleniumuts-1.2.2 → seleniumuts-1.2.4}/seleniumUts/custom_driver.py +0 -0
- {seleniumuts-1.2.2 → seleniumuts-1.2.4}/seleniumUts/uts.py +0 -0
- {seleniumuts-1.2.2 → seleniumuts-1.2.4}/seleniumUts.egg-info/SOURCES.txt +0 -0
- {seleniumuts-1.2.2 → seleniumuts-1.2.4}/seleniumUts.egg-info/dependency_links.txt +0 -0
- {seleniumuts-1.2.2 → seleniumuts-1.2.4}/seleniumUts.egg-info/requires.txt +0 -0
- {seleniumuts-1.2.2 → seleniumuts-1.2.4}/seleniumUts.egg-info/top_level.txt +0 -0
- {seleniumuts-1.2.2 → seleniumuts-1.2.4}/setup.cfg +0 -0
|
@@ -10,6 +10,7 @@ from glob import glob
|
|
|
10
10
|
import base64
|
|
11
11
|
import secrets
|
|
12
12
|
import string
|
|
13
|
+
import os
|
|
13
14
|
|
|
14
15
|
from contextlib import contextmanager
|
|
15
16
|
import tempfile
|
|
@@ -288,7 +289,7 @@ class SeleniumUts:
|
|
|
288
289
|
|
|
289
290
|
self.driver.switch_to.window(new_window)
|
|
290
291
|
|
|
291
|
-
def back_main_tab(self):
|
|
292
|
+
def back_main_tab(self,close_others=False):
|
|
292
293
|
"""
|
|
293
294
|
Desc:
|
|
294
295
|
Switch back to the first browser tab.\n
|
|
@@ -296,6 +297,12 @@ class SeleniumUts:
|
|
|
296
297
|
"""
|
|
297
298
|
windows = self.driver.window_handles
|
|
298
299
|
self.driver.switch_to.window(windows[0])
|
|
300
|
+
if close_others and len(windows) > 1:
|
|
301
|
+
for window in windows[1:]:
|
|
302
|
+
self.driver.switch_to.window(window)
|
|
303
|
+
self.driver.close()
|
|
304
|
+
self.driver.switch_to.window(windows[0])
|
|
305
|
+
|
|
299
306
|
|
|
300
307
|
def go_to_tab(self, index):
|
|
301
308
|
"""
|
|
@@ -610,6 +617,7 @@ class SeleniumUts:
|
|
|
610
617
|
web_options.add_argument(op)
|
|
611
618
|
|
|
612
619
|
if profile:
|
|
620
|
+
os.makedirs(profile, exist_ok=True)
|
|
613
621
|
web_options.add_argument(r"user-data-dir={}".format(profile))
|
|
614
622
|
|
|
615
623
|
web_options.headless = False
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|