seleniumbase 4.42.4__py3-none-any.whl → 4.42.6__py3-none-any.whl
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.
Potentially problematic release.
This version of seleniumbase might be problematic. Click here for more details.
- seleniumbase/__version__.py +1 -1
- seleniumbase/core/browser_launcher.py +12 -8
- seleniumbase/core/sb_cdp.py +123 -9
- seleniumbase/fixtures/base_case.py +14 -12
- seleniumbase/fixtures/js_utils.py +12 -3
- seleniumbase/fixtures/page_actions.py +1 -1
- seleniumbase/fixtures/shared_utils.py +20 -1
- seleniumbase/undetected/cdp_driver/cdp_util.py +16 -7
- seleniumbase/undetected/cdp_driver/config.py +1 -0
- {seleniumbase-4.42.4.dist-info → seleniumbase-4.42.6.dist-info}/METADATA +12 -9
- {seleniumbase-4.42.4.dist-info → seleniumbase-4.42.6.dist-info}/RECORD +15 -15
- {seleniumbase-4.42.4.dist-info → seleniumbase-4.42.6.dist-info}/WHEEL +0 -0
- {seleniumbase-4.42.4.dist-info → seleniumbase-4.42.6.dist-info}/entry_points.txt +0 -0
- {seleniumbase-4.42.4.dist-info → seleniumbase-4.42.6.dist-info}/licenses/LICENSE +0 -0
- {seleniumbase-4.42.4.dist-info → seleniumbase-4.42.6.dist-info}/top_level.txt +0 -0
seleniumbase/__version__.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# seleniumbase package
|
|
2
|
-
__version__ = "4.42.
|
|
2
|
+
__version__ = "4.42.6"
|
|
@@ -756,12 +756,16 @@ def uc_open_with_cdp_mode(driver, url=None, **kwargs):
|
|
|
756
756
|
cdp.set_value = CDPM.set_value
|
|
757
757
|
cdp.submit = CDPM.submit
|
|
758
758
|
cdp.evaluate = CDPM.evaluate
|
|
759
|
+
cdp.execute_script = CDPM.execute_script
|
|
759
760
|
cdp.js_dumps = CDPM.js_dumps
|
|
760
761
|
cdp.maximize = CDPM.maximize
|
|
761
762
|
cdp.minimize = CDPM.minimize
|
|
762
763
|
cdp.medimize = CDPM.medimize
|
|
763
764
|
cdp.set_window_rect = CDPM.set_window_rect
|
|
764
765
|
cdp.reset_window_size = CDPM.reset_window_size
|
|
766
|
+
cdp.activate_messenger = CDPM.activate_messenger
|
|
767
|
+
cdp.set_messenger_theme = CDPM.set_messenger_theme
|
|
768
|
+
cdp.post_message = CDPM.post_message
|
|
765
769
|
cdp.set_locale = CDPM.set_locale
|
|
766
770
|
cdp.set_local_storage_item = CDPM.set_local_storage_item
|
|
767
771
|
cdp.set_session_storage_item = CDPM.set_session_storage_item
|
|
@@ -877,6 +881,8 @@ def uc_open_with_cdp_mode(driver, url=None, **kwargs):
|
|
|
877
881
|
cdp.scroll_to_bottom = CDPM.scroll_to_bottom
|
|
878
882
|
cdp.scroll_up = CDPM.scroll_up
|
|
879
883
|
cdp.scroll_down = CDPM.scroll_down
|
|
884
|
+
cdp.save_page_source = CDPM.save_page_source
|
|
885
|
+
cdp.save_as_html = CDPM.save_as_html
|
|
880
886
|
cdp.save_screenshot = CDPM.save_screenshot
|
|
881
887
|
cdp.print_to_pdf = CDPM.print_to_pdf
|
|
882
888
|
cdp.save_as_pdf = CDPM.save_as_pdf
|
|
@@ -979,17 +985,15 @@ def __install_pyautogui_if_missing():
|
|
|
979
985
|
import pyautogui
|
|
980
986
|
with suppress(Exception):
|
|
981
987
|
use_pyautogui_ver = constants.PyAutoGUI.VER
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
)
|
|
988
|
+
u_pv = shared_utils.make_version_tuple(use_pyautogui_ver)
|
|
989
|
+
pv = shared_utils.make_version_tuple(pyautogui.__version__)
|
|
990
|
+
if pv < u_pv:
|
|
991
|
+
del pyautogui # To get newer ver
|
|
992
|
+
shared_utils.pip_install("pyautogui", version="Latest")
|
|
987
993
|
import pyautogui
|
|
988
994
|
except Exception:
|
|
989
995
|
print("\nPyAutoGUI required! Installing now...")
|
|
990
|
-
shared_utils.pip_install(
|
|
991
|
-
"pyautogui", version=constants.PyAutoGUI.VER
|
|
992
|
-
)
|
|
996
|
+
shared_utils.pip_install("pyautogui", version="Latest")
|
|
993
997
|
try:
|
|
994
998
|
import pyautogui
|
|
995
999
|
except Exception:
|
seleniumbase/core/sb_cdp.py
CHANGED
|
@@ -912,6 +912,12 @@ class CDPMethods():
|
|
|
912
912
|
element.scroll_into_view()
|
|
913
913
|
if text.endswith("\n") or text.endswith("\r"):
|
|
914
914
|
text = text[:-1] + "\r\n"
|
|
915
|
+
elif (
|
|
916
|
+
element.tag_name == "textarea"
|
|
917
|
+
and "\n" in text
|
|
918
|
+
and "\r" not in text
|
|
919
|
+
):
|
|
920
|
+
text = text.replace("\n", "\r")
|
|
915
921
|
element.send_keys(text)
|
|
916
922
|
self.__slow_mode_pause_if_set()
|
|
917
923
|
self.loop.run_until_complete(self.page.sleep(0.025))
|
|
@@ -927,6 +933,12 @@ class CDPMethods():
|
|
|
927
933
|
if text.endswith("\n") or text.endswith("\r"):
|
|
928
934
|
submit = True
|
|
929
935
|
text = text[:-1]
|
|
936
|
+
elif (
|
|
937
|
+
element.tag_name == "textarea"
|
|
938
|
+
and "\n" in text
|
|
939
|
+
and "\r" not in text
|
|
940
|
+
):
|
|
941
|
+
text = text.replace("\n", "\r")
|
|
930
942
|
for key in text:
|
|
931
943
|
element.send_keys(key)
|
|
932
944
|
time.sleep(0.044)
|
|
@@ -947,6 +959,12 @@ class CDPMethods():
|
|
|
947
959
|
element.clear_input()
|
|
948
960
|
if text.endswith("\n") or text.endswith("\r"):
|
|
949
961
|
text = text[:-1] + "\r\n"
|
|
962
|
+
elif (
|
|
963
|
+
element.tag_name == "textarea"
|
|
964
|
+
and "\n" in text
|
|
965
|
+
and "\r" not in text
|
|
966
|
+
):
|
|
967
|
+
text = text.replace("\n", "\r")
|
|
950
968
|
element.send_keys(text)
|
|
951
969
|
self.__slow_mode_pause_if_set()
|
|
952
970
|
self.loop.run_until_complete(self.page.sleep(0.025))
|
|
@@ -1024,6 +1042,9 @@ class CDPMethods():
|
|
|
1024
1042
|
).strip()
|
|
1025
1043
|
return self.loop.run_until_complete(self.page.evaluate(expression))
|
|
1026
1044
|
|
|
1045
|
+
def execute_script(self, expression):
|
|
1046
|
+
return self.evaluate(expression)
|
|
1047
|
+
|
|
1027
1048
|
def js_dumps(self, obj_name):
|
|
1028
1049
|
"""Similar to evaluate(), but for dictionary results."""
|
|
1029
1050
|
if obj_name.startswith("return "):
|
|
@@ -1407,6 +1428,64 @@ class CDPMethods():
|
|
|
1407
1428
|
mfa_code = self.get_mfa_code(totp_key)
|
|
1408
1429
|
self.type(selector, mfa_code + "\n", timeout=timeout)
|
|
1409
1430
|
|
|
1431
|
+
def activate_messenger(self):
|
|
1432
|
+
js_utils.activate_messenger(self)
|
|
1433
|
+
self.__add_light_pause()
|
|
1434
|
+
|
|
1435
|
+
def set_messenger_theme(
|
|
1436
|
+
self, theme="default", location="default", max_messages="default"
|
|
1437
|
+
):
|
|
1438
|
+
"""Sets a theme for posting messages.
|
|
1439
|
+
Themes: ["flat", "future", "block", "air", "ice"]
|
|
1440
|
+
Locations: ["top_left", "top_center", "top_right",
|
|
1441
|
+
"bottom_left", "bottom_center", "bottom_right"]
|
|
1442
|
+
max_messages: The limit of concurrent messages to display."""
|
|
1443
|
+
if not theme:
|
|
1444
|
+
theme = "default" # "flat"
|
|
1445
|
+
if not location:
|
|
1446
|
+
location = "default" # "bottom_right"
|
|
1447
|
+
if not max_messages:
|
|
1448
|
+
max_messages = "default" # "8"
|
|
1449
|
+
else:
|
|
1450
|
+
max_messages = str(max_messages) # Value must be in string format
|
|
1451
|
+
js_utils.set_messenger_theme(
|
|
1452
|
+
self,
|
|
1453
|
+
theme=theme,
|
|
1454
|
+
location=location,
|
|
1455
|
+
max_messages=max_messages,
|
|
1456
|
+
)
|
|
1457
|
+
self.__add_light_pause()
|
|
1458
|
+
|
|
1459
|
+
def post_message(self, message, duration=None, pause=True, style="info"):
|
|
1460
|
+
"""Post a message on the screen with Messenger.
|
|
1461
|
+
Arguments:
|
|
1462
|
+
message: The message to display.
|
|
1463
|
+
duration: The time until the message vanishes. (Default: 2.55s)
|
|
1464
|
+
pause: If True, the program waits until the message completes.
|
|
1465
|
+
style: "info", "success", or "error"."""
|
|
1466
|
+
driver = self.driver
|
|
1467
|
+
if hasattr(driver, "cdp_base"):
|
|
1468
|
+
driver = driver.cdp_base
|
|
1469
|
+
if style not in ["info", "success", "error"]:
|
|
1470
|
+
style = "info"
|
|
1471
|
+
if not duration:
|
|
1472
|
+
duration = settings.DEFAULT_MESSAGE_DURATION
|
|
1473
|
+
if (
|
|
1474
|
+
(
|
|
1475
|
+
driver.config.headless
|
|
1476
|
+
or (hasattr(sb_config, "xvfb") and sb_config.xvfb)
|
|
1477
|
+
)
|
|
1478
|
+
and float(duration) > 0.75
|
|
1479
|
+
):
|
|
1480
|
+
duration = 0.75
|
|
1481
|
+
try:
|
|
1482
|
+
js_utils.post_message(self, message, duration, style=style)
|
|
1483
|
+
except Exception:
|
|
1484
|
+
print(" * %s message: %s" % (style.upper(), message))
|
|
1485
|
+
if pause:
|
|
1486
|
+
duration = float(duration) + 0.15
|
|
1487
|
+
time.sleep(float(duration))
|
|
1488
|
+
|
|
1410
1489
|
def set_locale(self, locale):
|
|
1411
1490
|
"""(Settings will take effect on the next page load)"""
|
|
1412
1491
|
self.loop.run_until_complete(self.page.set_locale(locale))
|
|
@@ -1494,23 +1573,24 @@ class CDPMethods():
|
|
|
1494
1573
|
import pyautogui
|
|
1495
1574
|
with suppress(Exception):
|
|
1496
1575
|
use_pyautogui_ver = constants.PyAutoGUI.VER
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
)
|
|
1576
|
+
u_pv = shared_utils.make_version_tuple(use_pyautogui_ver)
|
|
1577
|
+
pv = shared_utils.make_version_tuple(pyautogui.__version__)
|
|
1578
|
+
if pv < u_pv:
|
|
1579
|
+
del pyautogui # To get newer ver
|
|
1580
|
+
shared_utils.pip_install("pyautogui", version="Latest")
|
|
1502
1581
|
import pyautogui
|
|
1503
1582
|
except Exception:
|
|
1504
1583
|
print("\nPyAutoGUI required! Installing now...")
|
|
1505
|
-
shared_utils.pip_install(
|
|
1506
|
-
"pyautogui", version=constants.PyAutoGUI.VER
|
|
1507
|
-
)
|
|
1584
|
+
shared_utils.pip_install("pyautogui", version="Latest")
|
|
1508
1585
|
try:
|
|
1509
1586
|
import pyautogui
|
|
1510
1587
|
except Exception:
|
|
1511
1588
|
if (
|
|
1512
1589
|
shared_utils.is_linux()
|
|
1513
|
-
and (
|
|
1590
|
+
and (
|
|
1591
|
+
not sb_config.headed
|
|
1592
|
+
or (hasattr(sb_config, "xvfb") and sb_config.xvfb)
|
|
1593
|
+
)
|
|
1514
1594
|
and not driver.config.headless
|
|
1515
1595
|
and (
|
|
1516
1596
|
not hasattr(sb_config, "_virtual_display")
|
|
@@ -2611,6 +2691,40 @@ class CDPMethods():
|
|
|
2611
2691
|
self.loop.run_until_complete(self.page.scroll_down(amount))
|
|
2612
2692
|
self.loop.run_until_complete(self.page.wait())
|
|
2613
2693
|
|
|
2694
|
+
def save_page_source(self, name, folder=None):
|
|
2695
|
+
import codecs
|
|
2696
|
+
from seleniumbase.core import log_helper
|
|
2697
|
+
if not name.endswith(".html"):
|
|
2698
|
+
name = name + ".html"
|
|
2699
|
+
if folder:
|
|
2700
|
+
abs_path = os.path.abspath(".")
|
|
2701
|
+
file_path = os.path.join(abs_path, folder)
|
|
2702
|
+
if not os.path.exists(file_path):
|
|
2703
|
+
os.makedirs(file_path)
|
|
2704
|
+
html_file_path = os.path.join(file_path, name)
|
|
2705
|
+
else:
|
|
2706
|
+
html_file_path = name
|
|
2707
|
+
page_source = self.get_page_source()
|
|
2708
|
+
last_page = self.get_current_url()
|
|
2709
|
+
meta_charset = '<meta charset="utf-8">'
|
|
2710
|
+
rendered_source = ""
|
|
2711
|
+
if "://" in last_page:
|
|
2712
|
+
base_href_html = log_helper.get_base_href_html(last_page)
|
|
2713
|
+
if ' charset="' not in page_source:
|
|
2714
|
+
rendered_source = "%s\n%s\n%s" % (
|
|
2715
|
+
base_href_html, meta_charset, page_source
|
|
2716
|
+
)
|
|
2717
|
+
else:
|
|
2718
|
+
rendered_source = "%s\n%s" % (base_href_html, page_source)
|
|
2719
|
+
else:
|
|
2720
|
+
rendered_source = page_source
|
|
2721
|
+
html_file = codecs.open(html_file_path, "w+", "utf-8")
|
|
2722
|
+
html_file.write(rendered_source)
|
|
2723
|
+
html_file.close()
|
|
2724
|
+
|
|
2725
|
+
def save_as_html(self, *args, **kwargs):
|
|
2726
|
+
self.save_page_source(*args, **kwargs)
|
|
2727
|
+
|
|
2614
2728
|
def save_screenshot(self, name, folder=None, selector=None):
|
|
2615
2729
|
filename = name
|
|
2616
2730
|
if folder:
|
|
@@ -114,9 +114,7 @@ class BaseCase(unittest.TestCase):
|
|
|
114
114
|
self.driver = None
|
|
115
115
|
self.environment = None
|
|
116
116
|
self.env = None # Add a shortened version of self.environment
|
|
117
|
-
self.version_list =
|
|
118
|
-
int(i) for i in __version__.split(".") if i.isdigit()
|
|
119
|
-
]
|
|
117
|
+
self.version_list = shared_utils.make_version_list(__version__)
|
|
120
118
|
self.version_tuple = tuple(self.version_list)
|
|
121
119
|
self.version_info = self.version_tuple
|
|
122
120
|
self.time = time.time
|
|
@@ -9205,6 +9203,10 @@ class BaseCase(unittest.TestCase):
|
|
|
9205
9203
|
"""Same as self.switch_to_newest_window()"""
|
|
9206
9204
|
self.switch_to_newest_window()
|
|
9207
9205
|
|
|
9206
|
+
def save_as_html(self, name, folder=None):
|
|
9207
|
+
"""Same as self.save_page_source()"""
|
|
9208
|
+
self.save_page_source(name, folder=folder)
|
|
9209
|
+
|
|
9208
9210
|
def input(
|
|
9209
9211
|
self, selector, text, by="css selector", timeout=None, retry=False
|
|
9210
9212
|
):
|
|
@@ -9654,9 +9656,11 @@ class BaseCase(unittest.TestCase):
|
|
|
9654
9656
|
|
|
9655
9657
|
def activate_messenger(self):
|
|
9656
9658
|
self.__check_scope()
|
|
9657
|
-
self.
|
|
9659
|
+
if not self.__is_cdp_swap_needed():
|
|
9660
|
+
self._check_browser()
|
|
9658
9661
|
js_utils.activate_messenger(self.driver)
|
|
9659
|
-
self.
|
|
9662
|
+
if not self.__is_cdp_swap_needed():
|
|
9663
|
+
self.wait_for_ready_state_complete()
|
|
9660
9664
|
|
|
9661
9665
|
def set_messenger_theme(
|
|
9662
9666
|
self, theme="default", location="default", max_messages="default"
|
|
@@ -14485,11 +14489,11 @@ class BaseCase(unittest.TestCase):
|
|
|
14485
14489
|
import pyautogui
|
|
14486
14490
|
with suppress(Exception):
|
|
14487
14491
|
use_pyautogui_ver = constants.PyAutoGUI.VER
|
|
14488
|
-
|
|
14492
|
+
u_pv = shared_utils.make_version_tuple(use_pyautogui_ver)
|
|
14493
|
+
pv = shared_utils.make_version_tuple(pyautogui.__version__)
|
|
14494
|
+
if pv < u_pv:
|
|
14489
14495
|
del pyautogui # To get newer ver
|
|
14490
|
-
shared_utils.pip_install(
|
|
14491
|
-
"pyautogui", version=use_pyautogui_ver
|
|
14492
|
-
)
|
|
14496
|
+
shared_utils.pip_install("pyautogui", version="Latest")
|
|
14493
14497
|
import pyautogui
|
|
14494
14498
|
pyautogui_is_installed = True
|
|
14495
14499
|
except Exception:
|
|
@@ -14498,9 +14502,7 @@ class BaseCase(unittest.TestCase):
|
|
|
14498
14502
|
"Installing now..."
|
|
14499
14503
|
)
|
|
14500
14504
|
print("\n" + message)
|
|
14501
|
-
shared_utils.pip_install(
|
|
14502
|
-
"pyautogui", version=constants.PyAutoGUI.VER
|
|
14503
|
-
)
|
|
14505
|
+
shared_utils.pip_install("pyautogui", version="Latest")
|
|
14504
14506
|
import pyautogui
|
|
14505
14507
|
pyautogui_is_installed = True
|
|
14506
14508
|
if (
|
|
@@ -29,6 +29,8 @@ def wait_for_ready_state_complete(driver, timeout=settings.LARGE_TIMEOUT):
|
|
|
29
29
|
If the timeout is exceeded, the test will still continue
|
|
30
30
|
because readyState == "interactive" may be good enough.
|
|
31
31
|
(Previously, tests would fail immediately if exceeding the timeout.)"""
|
|
32
|
+
if hasattr(driver, "_swap_driver"):
|
|
33
|
+
return
|
|
32
34
|
if hasattr(settings, "SKIP_JS_WAITS") and settings.SKIP_JS_WAITS:
|
|
33
35
|
return
|
|
34
36
|
start_ms = time.time() * 1000.0
|
|
@@ -54,8 +56,12 @@ def wait_for_ready_state_complete(driver, timeout=settings.LARGE_TIMEOUT):
|
|
|
54
56
|
|
|
55
57
|
|
|
56
58
|
def execute_async_script(driver, script, timeout=settings.LARGE_TIMEOUT):
|
|
57
|
-
driver
|
|
58
|
-
|
|
59
|
+
if hasattr(driver, "set_script_timeout"):
|
|
60
|
+
driver.set_script_timeout(timeout)
|
|
61
|
+
if hasattr(driver, "execute_async_script"):
|
|
62
|
+
return driver.execute_async_script(script)
|
|
63
|
+
else:
|
|
64
|
+
return None
|
|
59
65
|
|
|
60
66
|
|
|
61
67
|
def wait_for_angularjs(driver, timeout=settings.LARGE_TIMEOUT, **kwargs):
|
|
@@ -937,7 +943,10 @@ def post_message(driver, message, msg_dur=None, style="info"):
|
|
|
937
943
|
execute_script(driver, messenger_script)
|
|
938
944
|
except TypeError as e:
|
|
939
945
|
if (
|
|
940
|
-
|
|
946
|
+
(
|
|
947
|
+
shared_utils.is_cdp_swap_needed(driver)
|
|
948
|
+
or hasattr(driver, "_swap_driver")
|
|
949
|
+
)
|
|
941
950
|
and "cannot unpack non-iterable" in str(e)
|
|
942
951
|
):
|
|
943
952
|
pass
|
|
@@ -1528,10 +1528,10 @@ def save_page_source(driver, name, folder=None):
|
|
|
1528
1528
|
page_source = driver.cdp.get_page_source()
|
|
1529
1529
|
else:
|
|
1530
1530
|
page_source = driver.page_source
|
|
1531
|
-
html_file = codecs.open(html_file_path, "w+", "utf-8")
|
|
1532
1531
|
rendered_source = log_helper.get_html_source_with_base_href(
|
|
1533
1532
|
driver, page_source
|
|
1534
1533
|
)
|
|
1534
|
+
html_file = codecs.open(html_file_path, "w+", "utf-8")
|
|
1535
1535
|
html_file.write(rendered_source)
|
|
1536
1536
|
html_file.close()
|
|
1537
1537
|
|
|
@@ -18,16 +18,35 @@ def pip_install(package, version=None):
|
|
|
18
18
|
pip_install_lock = fasteners.InterProcessLock(
|
|
19
19
|
constants.PipInstall.LOCKFILE
|
|
20
20
|
)
|
|
21
|
+
upgrade_to_latest = False
|
|
22
|
+
if (
|
|
23
|
+
version
|
|
24
|
+
and ("U" in str(version).upper() or "L" in str(version).upper())
|
|
25
|
+
):
|
|
26
|
+
# Upgrade to Latest when specified with "U" or "L"
|
|
27
|
+
upgrade_to_latest = True
|
|
21
28
|
with pip_install_lock:
|
|
22
29
|
if not version:
|
|
23
30
|
subprocess.check_call(
|
|
24
31
|
[sys.executable, "-m", "pip", "install", package]
|
|
25
32
|
)
|
|
26
|
-
|
|
33
|
+
elif not upgrade_to_latest:
|
|
27
34
|
package_and_version = package + "==" + str(version)
|
|
28
35
|
subprocess.check_call(
|
|
29
36
|
[sys.executable, "-m", "pip", "install", package_and_version]
|
|
30
37
|
)
|
|
38
|
+
else:
|
|
39
|
+
subprocess.check_call(
|
|
40
|
+
[sys.executable, "-m", "pip", "install", "-U", package]
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def make_version_list(version_str):
|
|
45
|
+
return [int(i) for i in version_str.split(".") if i.isdigit()]
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def make_version_tuple(version_str):
|
|
49
|
+
return tuple(make_version_list(version_str))
|
|
31
50
|
|
|
32
51
|
|
|
33
52
|
def get_mfa_code(totp_key=None):
|
|
@@ -121,22 +121,26 @@ def __activate_virtual_display_as_needed(
|
|
|
121
121
|
import pyautogui
|
|
122
122
|
with suppress(Exception):
|
|
123
123
|
use_pyautogui_ver = constants.PyAutoGUI.VER
|
|
124
|
-
|
|
124
|
+
u_pv = shared_utils.make_version_tuple(
|
|
125
|
+
use_pyautogui_ver
|
|
126
|
+
)
|
|
127
|
+
pv = shared_utils.make_version_tuple(
|
|
128
|
+
pyautogui.__version__
|
|
129
|
+
)
|
|
130
|
+
if pv < u_pv:
|
|
125
131
|
del pyautogui # To get newer ver
|
|
126
132
|
shared_utils.pip_install(
|
|
127
|
-
"pyautogui", version=
|
|
133
|
+
"pyautogui", version="Latest"
|
|
128
134
|
)
|
|
129
135
|
import pyautogui
|
|
130
136
|
pyautogui_is_installed = True
|
|
131
137
|
except Exception:
|
|
132
138
|
message = (
|
|
133
|
-
"PyAutoGUI is required for
|
|
139
|
+
"PyAutoGUI is required for CDP Mode on Linux! "
|
|
134
140
|
"Installing now..."
|
|
135
141
|
)
|
|
136
142
|
print("\n" + message)
|
|
137
|
-
shared_utils.pip_install(
|
|
138
|
-
"pyautogui", version=constants.PyAutoGUI.VER
|
|
139
|
-
)
|
|
143
|
+
shared_utils.pip_install("pyautogui", version="Latest")
|
|
140
144
|
import pyautogui
|
|
141
145
|
pyautogui_is_installed = True
|
|
142
146
|
if (
|
|
@@ -335,6 +339,8 @@ async def start(
|
|
|
335
339
|
xvfb = True
|
|
336
340
|
else:
|
|
337
341
|
xvfb = False
|
|
342
|
+
if not hasattr(sb_config, "xvfb"):
|
|
343
|
+
sb_config.xvfb = xvfb
|
|
338
344
|
if incognito is None:
|
|
339
345
|
if "--incognito" in sys_argv:
|
|
340
346
|
incognito = True
|
|
@@ -687,7 +693,10 @@ def start_sync(*args, **kwargs) -> Browser:
|
|
|
687
693
|
|
|
688
694
|
|
|
689
695
|
async def create_from_driver(driver) -> Browser:
|
|
690
|
-
"""Create a Browser instance from a running driver
|
|
696
|
+
"""Create a CDP Browser instance from a running UC driver.
|
|
697
|
+
This method is DEPRECATED in favor of activate_cdp_mode(),
|
|
698
|
+
which includes the option of switching between the modes,
|
|
699
|
+
and also properly handles configuration based on options."""
|
|
691
700
|
from .config import Config
|
|
692
701
|
|
|
693
702
|
conf = Config()
|
|
@@ -202,6 +202,7 @@ class Config:
|
|
|
202
202
|
"InsecureDownloadWarnings,DownloadBubble,DownloadBubbleV2,"
|
|
203
203
|
"OptimizationTargetPrediction,OptimizationGuideModelDownloading,"
|
|
204
204
|
"SidePanelPinning,UserAgentClientHint,PrivacySandboxSettings4,"
|
|
205
|
+
"OptimizationHintsFetching,InterestFeedContentSuggestions,"
|
|
205
206
|
"DisableLoadExtensionCommandLineSwitch"
|
|
206
207
|
]
|
|
207
208
|
if self.proxy:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: seleniumbase
|
|
3
|
-
Version: 4.42.
|
|
3
|
+
Version: 4.42.6
|
|
4
4
|
Summary: A complete web automation framework for end-to-end testing.
|
|
5
5
|
Home-page: https://github.com/seleniumbase/SeleniumBase
|
|
6
6
|
Author: Michael Mintz
|
|
@@ -75,7 +75,7 @@ Requires-Dist: filelock~=3.16.1; python_version < "3.9"
|
|
|
75
75
|
Requires-Dist: filelock~=3.19.1; python_version >= "3.9" and python_version < "3.10"
|
|
76
76
|
Requires-Dist: filelock>=3.20.0; python_version >= "3.10"
|
|
77
77
|
Requires-Dist: fasteners>=0.20
|
|
78
|
-
Requires-Dist: mycdp>=1.2.
|
|
78
|
+
Requires-Dist: mycdp>=1.2.1
|
|
79
79
|
Requires-Dist: pynose>=1.5.5
|
|
80
80
|
Requires-Dist: platformdirs~=4.3.6; python_version < "3.9"
|
|
81
81
|
Requires-Dist: platformdirs~=4.4.0; python_version >= "3.9" and python_version < "3.10"
|
|
@@ -95,9 +95,9 @@ Requires-Dist: pygments>=2.19.2
|
|
|
95
95
|
Requires-Dist: pyreadline3>=3.5.4; platform_system == "Windows"
|
|
96
96
|
Requires-Dist: tabcompleter>=1.4.0
|
|
97
97
|
Requires-Dist: pdbp>=1.7.1
|
|
98
|
-
Requires-Dist: idna
|
|
98
|
+
Requires-Dist: idna>=3.11
|
|
99
99
|
Requires-Dist: chardet==5.2.0
|
|
100
|
-
Requires-Dist: charset-normalizer<4,>=3.4.
|
|
100
|
+
Requires-Dist: charset-normalizer<4,>=3.4.4
|
|
101
101
|
Requires-Dist: urllib3<2,>=1.26.20; python_version < "3.10"
|
|
102
102
|
Requires-Dist: urllib3<2.6.0,>=1.26.20; python_version >= "3.10"
|
|
103
103
|
Requires-Dist: requests==2.32.4; python_version < "3.9"
|
|
@@ -127,7 +127,8 @@ Requires-Dist: pytest-html==4.0.2
|
|
|
127
127
|
Requires-Dist: pytest-metadata==3.1.1
|
|
128
128
|
Requires-Dist: pytest-ordering==0.6
|
|
129
129
|
Requires-Dist: pytest-rerunfailures==14.0; python_version < "3.9"
|
|
130
|
-
Requires-Dist: pytest-rerunfailures==16.0.1; python_version >= "3.9"
|
|
130
|
+
Requires-Dist: pytest-rerunfailures==16.0.1; python_version >= "3.9" and python_version < "3.10"
|
|
131
|
+
Requires-Dist: pytest-rerunfailures==16.1; python_version >= "3.10"
|
|
131
132
|
Requires-Dist: pytest-xdist==3.6.1; python_version < "3.9"
|
|
132
133
|
Requires-Dist: pytest-xdist==3.8.0; python_version >= "3.9"
|
|
133
134
|
Requires-Dist: parameterized==0.9.0
|
|
@@ -148,7 +149,8 @@ Requires-Dist: allure-python-commons>=2.13.5; extra == "allure"
|
|
|
148
149
|
Requires-Dist: allure-behave>=2.13.5; extra == "allure"
|
|
149
150
|
Provides-Extra: coverage
|
|
150
151
|
Requires-Dist: coverage>=7.6.1; python_version < "3.9" and extra == "coverage"
|
|
151
|
-
Requires-Dist: coverage>=7.10.7; python_version >= "3.9" and extra == "coverage"
|
|
152
|
+
Requires-Dist: coverage>=7.10.7; (python_version >= "3.9" and python_version < "3.10") and extra == "coverage"
|
|
153
|
+
Requires-Dist: coverage>=7.11.0; python_version >= "3.10" and extra == "coverage"
|
|
152
154
|
Requires-Dist: pytest-cov>=5.0.0; python_version < "3.9" and extra == "coverage"
|
|
153
155
|
Requires-Dist: pytest-cov>=7.0.0; python_version >= "3.9" and extra == "coverage"
|
|
154
156
|
Provides-Extra: flake8
|
|
@@ -176,7 +178,8 @@ Requires-Dist: pycparser==2.22; python_version < "3.9" and extra == "pdfminer"
|
|
|
176
178
|
Requires-Dist: pycparser==2.23; python_version >= "3.9" and extra == "pdfminer"
|
|
177
179
|
Provides-Extra: pillow
|
|
178
180
|
Requires-Dist: Pillow>=10.4.0; python_version < "3.9" and extra == "pillow"
|
|
179
|
-
Requires-Dist: Pillow>=11.3.0; python_version >= "3.9" and extra == "pillow"
|
|
181
|
+
Requires-Dist: Pillow>=11.3.0; (python_version >= "3.9" and python_version < "3.10") and extra == "pillow"
|
|
182
|
+
Requires-Dist: Pillow>=12.0.0; python_version >= "3.10" and extra == "pillow"
|
|
180
183
|
Provides-Extra: pip-system-certs
|
|
181
184
|
Requires-Dist: pip-system-certs==4.0; platform_system == "Windows" and extra == "pip-system-certs"
|
|
182
185
|
Provides-Extra: proxy
|
|
@@ -268,13 +271,13 @@ Dynamic: summary
|
|
|
268
271
|
<br />
|
|
269
272
|
</p>
|
|
270
273
|
|
|
271
|
-
<p>SeleniumBase is
|
|
274
|
+
<p>SeleniumBase is used for automating browsers, testing websites, scraping data, and bypassing CAPTCHAs.</p>
|
|
272
275
|
|
|
273
276
|
--------
|
|
274
277
|
|
|
275
278
|
📚 Learn from [**over 200 examples** in the **SeleniumBase/examples/** folder](https://github.com/seleniumbase/SeleniumBase/tree/master/examples).
|
|
276
279
|
|
|
277
|
-
🐙
|
|
280
|
+
🐙 Stealth modes: <a translate="no" href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/uc_mode.md"><b>UC Mode</b></a> and <a translate="no" href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/ReadMe.md"><b>CDP Mode</b></a> help you evade bot-detection.
|
|
278
281
|
|
|
279
282
|
ℹ️ Most scripts run with raw <code translate="no"><b>python</b></code>, although some scripts use <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md">Syntax Formats</a> that expect <a href="https://docs.pytest.org/en/latest/how-to/usage.html" translate="no"><b>pytest</b></a> (a Python unit-testing framework included with SeleniumBase that can discover, collect, and run tests automatically).
|
|
280
283
|
|
|
@@ -3,7 +3,7 @@ sbase/__main__.py,sha256=G0bVB1-DM4PGwQ1KyOupaWCs4ePbChZNNWuX2htim5U,647
|
|
|
3
3
|
sbase/steps.py,sha256=wiPSWZhFpBlWvkqXRJ18btpBu3nQaw9K5AzIJNAX5RM,43521
|
|
4
4
|
seleniumbase/__init__.py,sha256=JFEY9P5QJqsa1M6ghzLMH2eIPQyh85iglCaQwg8Y8z4,2498
|
|
5
5
|
seleniumbase/__main__.py,sha256=dn1p6dgCchmcH1zzTzzQvFwwdQQqnTGH6ULV9m4hv24,654
|
|
6
|
-
seleniumbase/__version__.py,sha256=
|
|
6
|
+
seleniumbase/__version__.py,sha256=NduMJBypNeOGItaajvpq6CyjoWb3RO_0p6sVSx1E6ho,46
|
|
7
7
|
seleniumbase/behave/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
seleniumbase/behave/behave_helper.py,sha256=lJtagtivSbEpbRj0EKV4l4PuPU6NANONJJAnYwgVCe0,24379
|
|
9
9
|
seleniumbase/behave/behave_sb.py,sha256=guLihFsr1uJ4v2AR3r3Vy_BTeHrHwy2JEJxhp-MVnZA,59872
|
|
@@ -36,7 +36,7 @@ seleniumbase/console_scripts/sb_print.py,sha256=tNy-bMDgwHJO3bZxMpmo9weSE8uhbH0C
|
|
|
36
36
|
seleniumbase/console_scripts/sb_recorder.py,sha256=DH-n2fN7N9qyHMl7wjtn8MiliBgfw-1kwgmfg1GUuhk,10772
|
|
37
37
|
seleniumbase/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
38
38
|
seleniumbase/core/application_manager.py,sha256=e_0sjtI8cjY5BNyZj1QBR0j6_oCScxGmSXYEpcYwuZE,576
|
|
39
|
-
seleniumbase/core/browser_launcher.py,sha256=
|
|
39
|
+
seleniumbase/core/browser_launcher.py,sha256=N9VF8BmQFtIs6NBOD6neVjueaEAmDfJlmCi5mvN1Prk,251017
|
|
40
40
|
seleniumbase/core/capabilities_parser.py,sha256=meIS2uHapTCq2ldfNAToC7r0cKmZDRXuYNKExM1GHDY,6038
|
|
41
41
|
seleniumbase/core/colored_traceback.py,sha256=DrRWfg7XEnKcgY59Xj7Jdk09H-XqHYBSUpB-DiZt6iY,2020
|
|
42
42
|
seleniumbase/core/create_db_tables.sql,sha256=VWPtrdiW_HQ6yETHjqTu-VIrTwvd8I8o1NfBeaVSHpU,972
|
|
@@ -50,7 +50,7 @@ seleniumbase/core/proxy_helper.py,sha256=pZ1NboNfziHU3vWZLOZLX-qkfM3oKSnpc3omQf9
|
|
|
50
50
|
seleniumbase/core/recorder_helper.py,sha256=gDION28OK4NAYsE-7ohKZ9Z3sxQQ0FEjf859LDpqsg4,25320
|
|
51
51
|
seleniumbase/core/report_helper.py,sha256=AIl6Qava2yW1uSzbLpJBlPlYDz0KE-rVhogh8hsGWBo,12201
|
|
52
52
|
seleniumbase/core/s3_manager.py,sha256=z_4qx2jI_gtK5r3niGXgEOBpfMUicUCOciowai50MP4,3529
|
|
53
|
-
seleniumbase/core/sb_cdp.py,sha256=
|
|
53
|
+
seleniumbase/core/sb_cdp.py,sha256=Vs0rQCY294R7TAZzxuwa-MhAFUjm-BTkICA4IkhKJJo,108825
|
|
54
54
|
seleniumbase/core/sb_driver.py,sha256=-IQsskc7HpXQbcBL04IPjmGpyYchyo7v9OPF2WcahDw,14159
|
|
55
55
|
seleniumbase/core/session_helper.py,sha256=s9zD3PVZEWVzG2h81cCUskbNWLfdjC_LwwQjKptHCak,558
|
|
56
56
|
seleniumbase/core/settings_parser.py,sha256=gqVohHVlE_5L5Cqe2L24uYrRzvoK-saX8E_Df7_-_3I,7609
|
|
@@ -67,14 +67,14 @@ seleniumbase/extensions/disable_csp.zip,sha256=5RvomXnm2PdivUVcxTV6jfvD8WhTEsQYH
|
|
|
67
67
|
seleniumbase/extensions/recorder.zip,sha256=JEE_FVEvlS63cFQbVLEroIyPSS91nWCDL0MhjVrmIpk,11813
|
|
68
68
|
seleniumbase/extensions/sbase_ext.zip,sha256=3s1N8zrVaMz8RQEOIoBzC3KDjtmHwVZRvVsX25Odr_s,8175
|
|
69
69
|
seleniumbase/fixtures/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
70
|
-
seleniumbase/fixtures/base_case.py,sha256=
|
|
70
|
+
seleniumbase/fixtures/base_case.py,sha256=cTzBh-ndkowdmtrAtgJ7xgwyZUIonYDTBS6dS6R6yA0,741333
|
|
71
71
|
seleniumbase/fixtures/constants.py,sha256=WMrItuNyKq3XVJ64NluLIRc4gJCxDw8K8qXED0b9S2w,13752
|
|
72
72
|
seleniumbase/fixtures/css_to_xpath.py,sha256=9ouDB1xl4MJ2os6JOgTIAyHKOQfuxtxvXC3O5hSnEKA,1954
|
|
73
73
|
seleniumbase/fixtures/errors.py,sha256=KyxuEVx_e3MPhVrJfNIa_3ltMpbCFxfy_jxK8RFNTns,555
|
|
74
|
-
seleniumbase/fixtures/js_utils.py,sha256=
|
|
75
|
-
seleniumbase/fixtures/page_actions.py,sha256=
|
|
74
|
+
seleniumbase/fixtures/js_utils.py,sha256=waXwlyMx7-rIFI8mJ_R8cL_mvih_gXlcJ_wT5h38HbI,52517
|
|
75
|
+
seleniumbase/fixtures/page_actions.py,sha256=DvT0CzqFnpFGLfvmDk7zZ2XMcX_RxLYhNX6Nxxj4rRo,73213
|
|
76
76
|
seleniumbase/fixtures/page_utils.py,sha256=H1iV8f9vDyEy87DBntyiBXC_tg8HskcebUOAJVn0hxE,12160
|
|
77
|
-
seleniumbase/fixtures/shared_utils.py,sha256=
|
|
77
|
+
seleniumbase/fixtures/shared_utils.py,sha256=kn0rcF0tEkQkiT8RGVooNFsLnVWmdPeTH9PfIm86TOI,10527
|
|
78
78
|
seleniumbase/fixtures/unittest_helper.py,sha256=sfZ92rZeBAn_sF_yQ3I6_I7h3lyU5-cV_UMegBNoEm8,1294
|
|
79
79
|
seleniumbase/fixtures/words.py,sha256=FOA4mAYvl3EPVpBTvgvK6YwCL8BdlRCmed685kEe7Vg,7827
|
|
80
80
|
seleniumbase/fixtures/xpath_to_css.py,sha256=lML56k656fElXJ4NJF07r35FjctrbgQkXUotNk7A-as,8876
|
|
@@ -118,8 +118,8 @@ seleniumbase/undetected/webelement.py,sha256=OOpUYbEiOG52KsYYyuDW9tYLdA2SMnukvwQ
|
|
|
118
118
|
seleniumbase/undetected/cdp_driver/__init__.py,sha256=Ga9alwuaZZy4_XOShc0HjgFnNqpPdrcbjAicz5gE7a4,215
|
|
119
119
|
seleniumbase/undetected/cdp_driver/_contradict.py,sha256=lP4b0h5quAy573ETn_TBbYV889cL1AuPLVInpJ0ZkiU,3183
|
|
120
120
|
seleniumbase/undetected/cdp_driver/browser.py,sha256=JQlwMuwZgK0vWlvH4SU6DA7LcZo2I4hJRUIcv4gbZCQ,35609
|
|
121
|
-
seleniumbase/undetected/cdp_driver/cdp_util.py,sha256=
|
|
122
|
-
seleniumbase/undetected/cdp_driver/config.py,sha256=
|
|
121
|
+
seleniumbase/undetected/cdp_driver/cdp_util.py,sha256=XpzaUAbTL-4IciQ984x9QvA9HgYFzRlYrRv94fIfbpM,33918
|
|
122
|
+
seleniumbase/undetected/cdp_driver/config.py,sha256=B5Wf0E5xvCmIuLO_Y06oyKYd04yM2auj--JyGKUKsls,13630
|
|
123
123
|
seleniumbase/undetected/cdp_driver/connection.py,sha256=WgZ4QamXSdTzP4Xfgkn8mxv-JFivMG6hqbyHy2_LQlg,25717
|
|
124
124
|
seleniumbase/undetected/cdp_driver/element.py,sha256=FIC6v7OmumLCT-_vIc3H4oju_oBbaLpWJUJIKm2c_q4,40467
|
|
125
125
|
seleniumbase/undetected/cdp_driver/tab.py,sha256=t7Ucn0pmm7imwdCM-5KmIJNU2MCeMuIl6G3T2VMrbxU,53170
|
|
@@ -137,9 +137,9 @@ seleniumbase/utilities/selenium_grid/start-grid-hub.bat,sha256=Ftq-GrAKRYH2ssDPr
|
|
|
137
137
|
seleniumbase/utilities/selenium_grid/start-grid-hub.sh,sha256=KADv0RUHONLL2_I443QFK8PryBpDmKn5Gy0s4o0vDSM,106
|
|
138
138
|
seleniumbase/utilities/selenium_ide/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
139
139
|
seleniumbase/utilities/selenium_ide/convert_ide.py,sha256=pZFnqEJQEKZPyNFjkLD29s2HPQgCrWW9XJWpCPhWOoM,31691
|
|
140
|
-
seleniumbase-4.42.
|
|
141
|
-
seleniumbase-4.42.
|
|
142
|
-
seleniumbase-4.42.
|
|
143
|
-
seleniumbase-4.42.
|
|
144
|
-
seleniumbase-4.42.
|
|
145
|
-
seleniumbase-4.42.
|
|
140
|
+
seleniumbase-4.42.6.dist-info/licenses/LICENSE,sha256=BRblZsX7HyPUjQmYTiyWr_e9tzWvmR3R4SFclM2R3W0,1085
|
|
141
|
+
seleniumbase-4.42.6.dist-info/METADATA,sha256=n-eDmroQcKl5RS_f7yGQQg4lljQm7ncUPdUN8Fedj24,89717
|
|
142
|
+
seleniumbase-4.42.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
143
|
+
seleniumbase-4.42.6.dist-info/entry_points.txt,sha256=CNrh2EKNaHYEhO6pP1RJyVLB99LkDDYX7TnUK8xfjqk,623
|
|
144
|
+
seleniumbase-4.42.6.dist-info/top_level.txt,sha256=4N97aBOQ8ETCnDnokBsWb07lJfTaq3C1ZzYRxvLMxqU,19
|
|
145
|
+
seleniumbase-4.42.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|