seleniumbase 4.30.2__py3-none-any.whl → 4.30.3__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.
@@ -1,2 +1,2 @@
1
1
  # seleniumbase package
2
- __version__ = "4.30.2"
2
+ __version__ = "4.30.3"
@@ -861,10 +861,19 @@ def _uc_gui_click_captcha(
861
861
  visible_iframe = False
862
862
  if (
863
863
  frame != "iframe"
864
- and driver.is_element_present('[name*="cf-turnstile-"]')
865
- and driver.is_element_present("%s div[style]" % frame)
864
+ and driver.is_element_present(
865
+ "%s .cf-turnstile-wrapper" % frame
866
+ )
867
+ ):
868
+ frame = "%s .cf-turnstile-wrapper" % frame
869
+ elif (
870
+ frame != "iframe"
871
+ and driver.is_element_present(
872
+ '%s [name*="cf-turnstile"]' % frame
873
+ )
874
+ and driver.is_element_present("%s div" % frame)
866
875
  ):
867
- frame = "%s div[style]" % frame
876
+ frame = "%s div" % frame
868
877
  elif (
869
878
  driver.is_element_present('[name*="cf-turnstile-"]')
870
879
  and driver.is_element_present("div.spacer div")
@@ -877,47 +886,21 @@ def _uc_gui_click_captcha(
877
886
  )
878
887
  ):
879
888
  frame = '[data-testid*="challenge-"] div'
880
- elif (
881
- (
882
- driver.is_element_present('[name*="cf-turnstile-"]')
883
- or driver.is_element_present('[id*="cf-turnstile-"]')
884
- )
885
- and driver.is_element_present(
886
- 'form div div[style*="margin"][style*="padding"]'
887
- )
888
- ):
889
- frame = 'form div div[style*="margin"][style*="padding"]'
890
- elif (
891
- frame != "iframe"
892
- and driver.is_element_present(
893
- "%s .cf-turnstile-wrapper" % frame
894
- )
889
+ elif driver.is_element_present(
890
+ 'form div:not([class]):has(input[name*="cf-turn"])'
895
891
  ):
896
- frame = "%s .cf-turnstile-wrapper" % frame
892
+ frame = 'form div:not([class]):has(input[name*="cf-turn"])'
897
893
  elif (
898
- frame != "iframe"
899
- and driver.is_element_present(
900
- '%s [name*="cf-turnstile"]' % frame
901
- )
902
- and driver.is_element_present("%s div" % frame)
894
+ driver.is_element_present('[src*="/turnstile/"]')
895
+ and driver.is_element_present("form div:not(:has(*))")
903
896
  ):
904
- frame = "%s div" % frame
897
+ frame = "form div:not(:has(*))"
905
898
  elif driver.is_element_present(".cf-turnstile-wrapper"):
906
899
  frame = ".cf-turnstile-wrapper"
907
900
  elif driver.is_element_present(
908
901
  '[data-callback="onCaptchaSuccess"]'
909
902
  ):
910
903
  frame = '[data-callback="onCaptchaSuccess"]'
911
- elif (
912
- (
913
- driver.is_element_present('[name*="cf-turnstile-"]')
914
- or driver.is_element_present('[id*="cf-turnstile-"]')
915
- )
916
- and driver.is_element_present(
917
- 'div > div > [style*="margin"][style*="padding"]'
918
- )
919
- ):
920
- frame = 'div > div > [style*="margin"][style*="padding"]'
921
904
  else:
922
905
  return
923
906
  if driver.is_element_present('form[class*=center]'):
@@ -1100,6 +1083,8 @@ def _uc_gui_handle_captcha(
1100
1083
  driver.minimize_window()
1101
1084
  driver.set_window_rect(win_x, win_y, width, height)
1102
1085
  time.sleep(0.33)
1086
+ tab_up_first = False
1087
+ special_form = False
1103
1088
  if ctype == "cf_t":
1104
1089
  if (
1105
1090
  driver.is_element_present(".cf-turnstile-wrapper iframe")
@@ -1128,26 +1113,18 @@ def _uc_gui_handle_captcha(
1128
1113
  )
1129
1114
  ):
1130
1115
  frame = '[data-testid*="challenge-"] div'
1131
- elif (
1132
- (
1133
- driver.is_element_present('[name*="cf-turnstile-"]')
1134
- or driver.is_element_present('[id*="cf-turnstile-"]')
1135
- )
1136
- and driver.is_element_present(
1137
- 'form div div[style*="margin"][style*="padding"]'
1138
- )
1116
+ elif driver.is_element_present(
1117
+ 'form div:not([class]):has(input[name*="cf-turn"])'
1139
1118
  ):
1140
- frame = 'form div div[style*="margin"][style*="padding"]'
1119
+ frame = 'form div:not([class]):has(input[name*="cf-turn"])'
1120
+ tab_up_first = True
1121
+ special_form = True
1141
1122
  elif (
1142
- (
1143
- driver.is_element_present('[name*="cf-turnstile-"]')
1144
- or driver.is_element_present('[id*="cf-turnstile-"]')
1145
- )
1146
- and driver.is_element_present(
1147
- 'div > div > [style*="margin"][style*="padding"]'
1148
- )
1123
+ driver.is_element_present('[src*="/turnstile/"]')
1124
+ and driver.is_element_present("form div:not(:has(*))")
1149
1125
  ):
1150
- frame = 'div > div > [style*="margin"][style*="padding"]'
1126
+ frame = "form div:not(:has(*))"
1127
+ tab_up_first = True
1151
1128
  else:
1152
1129
  return
1153
1130
  else:
@@ -1172,13 +1149,18 @@ def _uc_gui_handle_captcha(
1172
1149
  if ctype == "g_rc":
1173
1150
  selector = "span#recaptcha-anchor"
1174
1151
  found_checkbox = False
1175
- for i in range(24):
1152
+ if tab_up_first:
1153
+ for i in range(10):
1154
+ pyautogui.hotkey("shift", "tab")
1155
+ time.sleep(0.027)
1156
+ for i in range(34):
1176
1157
  pyautogui.press("\t")
1177
- time.sleep(0.02)
1158
+ time.sleep(0.027)
1178
1159
  active_element_css = js_utils.get_active_element_css(driver)
1179
1160
  if (
1180
1161
  active_element_css.startswith(selector)
1181
1162
  or active_element_css.endswith(" > div" * 2)
1163
+ or (special_form and active_element_css.endswith(" div"))
1182
1164
  ):
1183
1165
  found_checkbox = True
1184
1166
  break
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: seleniumbase
3
- Version: 4.30.2
3
+ Version: 4.30.3
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
@@ -160,7 +160,7 @@ Requires-Dist: pdfminer.six ==20221105 ; (python_version < "3.8") and extra == '
160
160
  Requires-Dist: cffi ==1.15.1 ; (python_version < "3.8") and extra == 'pdfminer'
161
161
  Requires-Dist: cryptography ==39.0.2 ; (python_version < "3.9") and extra == 'pdfminer'
162
162
  Requires-Dist: pdfminer.six ==20240706 ; (python_version >= "3.8") and extra == 'pdfminer'
163
- Requires-Dist: cffi ==1.17.0 ; (python_version >= "3.8") and extra == 'pdfminer'
163
+ Requires-Dist: cffi ==1.17.1 ; (python_version >= "3.8") and extra == 'pdfminer'
164
164
  Requires-Dist: cryptography ==43.0.1 ; (python_version >= "3.9") and extra == 'pdfminer'
165
165
  Provides-Extra: pillow
166
166
  Requires-Dist: Pillow ==9.5.0 ; (python_version < "3.8") and extra == 'pillow'
@@ -239,13 +239,15 @@ Requires-Dist: pyasn1 ==0.6.0 ; (python_version >= "3.8") and extra == 'selenium
239
239
  <br />
240
240
  </p>
241
241
 
242
+ <p>SeleniumBase is the professional toolkit for web automation activities. Built for testing websites, bypassing CAPTCHAs, enhancing productivity, completing tasks, and scaling your business.</p>
243
+
242
244
  --------
243
245
 
244
246
  📚 Learn from [**over 200 examples** in the **SeleniumBase/examples/** folder](https://github.com/seleniumbase/SeleniumBase/tree/master/examples).
245
247
 
246
248
  👤 Note that <span translate="no">SeleniumBase</span> <a translate="no" href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/uc_mode.md"><b>UC Mode</b> (Stealth Mode) has its own ReadMe</a>.
247
249
 
248
- ℹ️ Scripts can be called via <code translate="no"><b>python</b></code>, although some <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md">Syntax Formats</a> 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 tests automatically).
250
+ ℹ️ Scripts can be called via <code translate="no"><b>python</b></code>, although some <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md">Syntax Formats</a> 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).
249
251
 
250
252
  <p align="left">📗 Here's <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py">my_first_test.py</a>, which tests login, shopping, and checkout:</p>
251
253
 
@@ -5,7 +5,7 @@ sbase/steps.py,sha256=bKT_u5bJkKzYWEuAXi9NVVRYYxQRCM1_YJUrNFFRVPY,42865
5
5
  seleniumbase/ReadMe.md,sha256=4nEdto4d0Ch0Zneg0yAC-RBBdqRqPUP0SCo-ze_XDPM,3612
6
6
  seleniumbase/__init__.py,sha256=dgq30q6wGO2fJOVYemxC5hLxzv-of-MRn5P1YarBq5k,2263
7
7
  seleniumbase/__main__.py,sha256=dn1p6dgCchmcH1zzTzzQvFwwdQQqnTGH6ULV9m4hv24,654
8
- seleniumbase/__version__.py,sha256=BdkAfSbnD0GdQ2ws-16m3-ETEGErOpRmMIK6vKT_YUs,46
8
+ seleniumbase/__version__.py,sha256=Oloi19JNV2Kk1XvsGrHH-4lT87W5MMes86obgvYyGDM,46
9
9
  seleniumbase/behave/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  seleniumbase/behave/behave_helper.py,sha256=elkl8P9eLulRAioLstE9baYNM9N_PHBmAOcajX-pH_Y,24198
11
11
  seleniumbase/behave/behave_sb.py,sha256=q4uYZixZBf7VYWnQnEk2weTcyMy1X1faR3vyYvUzDiA,56406
@@ -40,7 +40,7 @@ seleniumbase/console_scripts/sb_print.py,sha256=yo641b_OdSE0GUauOyxk-QrNeIjYzbRY
40
40
  seleniumbase/console_scripts/sb_recorder.py,sha256=UQQhnAR18dbcC7ToDvj6TM2PIG5qBrNaekaM6kSK_E8,10970
41
41
  seleniumbase/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
42
  seleniumbase/core/application_manager.py,sha256=e_0sjtI8cjY5BNyZj1QBR0j6_oCScxGmSXYEpcYwuZE,576
43
- seleniumbase/core/browser_launcher.py,sha256=S5caztJN0Al8eRFbsTAKQIugD8PpCQnMhvQIqqpO1j8,199052
43
+ seleniumbase/core/browser_launcher.py,sha256=ZW2-FmdYcAhl6xFTrPtIOniGz_CtJpbEg0EjGSZALQ4,198233
44
44
  seleniumbase/core/capabilities_parser.py,sha256=meIS2uHapTCq2ldfNAToC7r0cKmZDRXuYNKExM1GHDY,6038
45
45
  seleniumbase/core/colored_traceback.py,sha256=DrRWfg7XEnKcgY59Xj7Jdk09H-XqHYBSUpB-DiZt6iY,2020
46
46
  seleniumbase/core/create_db_tables.sql,sha256=VWPtrdiW_HQ6yETHjqTu-VIrTwvd8I8o1NfBeaVSHpU,972
@@ -137,9 +137,9 @@ seleniumbase/utilities/selenium_grid/start-grid-hub.sh,sha256=KADv0RUHONLL2_I443
137
137
  seleniumbase/utilities/selenium_ide/ReadMe.md,sha256=hznGeuMpkIimqMiZBW-4goIy2ltW4l8X9kb0YSPUQfE,4483
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.30.2.dist-info/LICENSE,sha256=odSYtWibXBnQ1gBg6CnDZ82n8kLF_if5-2nbqnEyD8k,1085
141
- seleniumbase-4.30.2.dist-info/METADATA,sha256=Zj_V_pSG-9cEhphk9j0wA0vP40xi-Fol8V40UMyTV0M,86175
142
- seleniumbase-4.30.2.dist-info/WHEEL,sha256=uCRv0ZEik_232NlR4YDw4Pv3Ajt5bKvMH13NUU7hFuI,91
143
- seleniumbase-4.30.2.dist-info/entry_points.txt,sha256=CNrh2EKNaHYEhO6pP1RJyVLB99LkDDYX7TnUK8xfjqk,623
144
- seleniumbase-4.30.2.dist-info/top_level.txt,sha256=4N97aBOQ8ETCnDnokBsWb07lJfTaq3C1ZzYRxvLMxqU,19
145
- seleniumbase-4.30.2.dist-info/RECORD,,
140
+ seleniumbase-4.30.3.dist-info/LICENSE,sha256=odSYtWibXBnQ1gBg6CnDZ82n8kLF_if5-2nbqnEyD8k,1085
141
+ seleniumbase-4.30.3.dist-info/METADATA,sha256=KbCnEa6cmntlRRwsX1h9YN6Gi_dQUyo0ytStEB7fprQ,86380
142
+ seleniumbase-4.30.3.dist-info/WHEEL,sha256=uCRv0ZEik_232NlR4YDw4Pv3Ajt5bKvMH13NUU7hFuI,91
143
+ seleniumbase-4.30.3.dist-info/entry_points.txt,sha256=CNrh2EKNaHYEhO6pP1RJyVLB99LkDDYX7TnUK8xfjqk,623
144
+ seleniumbase-4.30.3.dist-info/top_level.txt,sha256=4N97aBOQ8ETCnDnokBsWb07lJfTaq3C1ZzYRxvLMxqU,19
145
+ seleniumbase-4.30.3.dist-info/RECORD,,