Skip to content

Commit 72bc798

Browse files
authored
Merge pull request #2290 from seleniumbase/a-few-small-updates
A few small updates
2 parents 5f68c82 + 3966265 commit 72bc798

File tree

7 files changed

+23
-12
lines changed

7 files changed

+23
-12
lines changed

examples/hack_the_planet.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ def test_all_your_base_are_belong_to_us(self):
9797
self.open("https://dev.to/top/infinity")
9898
self.click_if_visible('button[aria-label="Close campaign banner"]')
9999
self.click_if_visible('svg[aria-label="Close campaign banner"]')
100-
self.hide_elements('main div:contains("Pinned")')
100+
try:
101+
self.hide_elements('main div:contains("Pinned")')
102+
except Exception:
103+
pass
101104
self.set_text_content('nav a[data-text="Relevant"]', "ALL")
102105
self.set_text_content('nav a[data-text="Latest"]', "YOUR")
103106
self.set_text_content('nav a[data-text="Top"]', "BASE")

examples/raw_uc_mode.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
from seleniumbase import SB
33

44
with SB(uc=True) as sb:
5-
sb.driver.get("https://nowsecure.nl/#relax")
6-
sb.sleep(1)
5+
sb.driver.uc_open_with_tab("https://nowsecure.nl/#relax")
6+
sb.sleep(1.2)
77
if not sb.is_text_visible("OH YEAH, you passed!", "h1"):
88
sb.get_new_driver(undetectable=True)
9-
sb.driver.get("https://nowsecure.nl/#relax")
10-
sb.sleep(1)
9+
sb.driver.uc_open_with_reconnect(
10+
"https://nowsecure.nl/#relax", reconnect_time=3
11+
)
12+
sb.sleep(1.2)
1113
if not sb.is_text_visible("OH YEAH, you passed!", "h1"):
1214
if sb.is_element_visible('iframe[src*="challenge"]'):
1315
with sb.frame_switch('iframe[src*="challenge"]'):

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pyotp==2.9.0
5757
markdown-it-py==2.2.0;python_version<"3.8"
5858
markdown-it-py==3.0.0;python_version>="3.8"
5959
mdurl==0.1.2
60-
rich==13.6.0
60+
rich==13.7.0
6161

6262
# --- Testing Requirements --- #
6363
# ("pip install -r requirements.txt" also installs this, but "pip install -e ." won't.)

seleniumbase/__version__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# seleniumbase package
2-
__version__ = "4.21.2"
2+
__version__ = "4.21.3"

seleniumbase/fixtures/base_case.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -7749,8 +7749,10 @@ def get_chrome_version(self):
77497749
driver_capabilities = self.driver.capabilities
77507750
if "version" in driver_capabilities:
77517751
chrome_version = driver_capabilities["version"]
7752-
else:
7752+
elif "browserVersion" in driver_capabilities:
77537753
chrome_version = driver_capabilities["browserVersion"]
7754+
else:
7755+
chrome_version = "(Unknown Version)"
77547756
return chrome_version
77557757

77567758
def get_chromium_version(self):
@@ -15563,8 +15565,10 @@ def _get_browser_version(self):
1556315565
return "(Unknown Version)"
1556415566
if "version" in driver_capabilities:
1556515567
browser_version = driver_capabilities["version"]
15566-
else:
15568+
elif "browserVersion" in driver_capabilities:
1556715569
browser_version = driver_capabilities["browserVersion"]
15570+
else:
15571+
browser_version = "(Unknown Version)"
1556815572
return browser_version
1556915573

1557015574
def _get_driver_name_and_version(self):

seleniumbase/undetected/__init__.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,10 @@ def quit(self):
439439
try:
440440
logger.debug("Terminating the UC browser")
441441
os.kill(self.browser_pid, 15)
442-
# Not sure if this is really needed:
443-
os.waitpid(self.browser_pid, 0)
442+
if IS_POSIX:
443+
os.waitpid(self.browser_pid, 0)
444+
else:
445+
time.sleep(0.05)
444446
except (AttributeError, ChildProcessError, RuntimeError, OSError):
445447
pass
446448
except TimeoutError as e:

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@
190190
'markdown-it-py==2.2.0;python_version<"3.8"',
191191
'markdown-it-py==3.0.0;python_version>="3.8"',
192192
'mdurl==0.1.2',
193-
'rich==13.6.0',
193+
'rich==13.7.0',
194194
],
195195
extras_require={
196196
# pip install -e .[allure]

0 commit comments

Comments
 (0)