MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / open_url

Function open_url

seleniumbase/fixtures/page_actions.py:1750–1774  ·  view source on GitHub ↗
(driver, url)

Source from the content-addressed store, hash-verified

1748# Support methods for direct use from driver
1749
1750def open_url(driver, url):
1751 if __is_cdp_swap_needed(driver):
1752 driver.cdp.open(url)
1753 return
1754 elif (
1755 getattr(driver, "_is_using_uc", None)
1756 # and getattr(driver, "_is_using_auth", None)
1757 and not getattr(driver, "_is_using_cdp", None)
1758 ):
1759 # Auth in UC Mode requires CDP Mode
1760 # (and now we're always forcing it)
1761 driver.uc_activate_cdp_mode(url)
1762 return
1763 elif (
1764 getattr(driver, "_is_using_uc", None)
1765 and getattr(driver, "_is_using_cdp", None)
1766 ):
1767 driver.disconnect()
1768 driver.cdp.open(url)
1769 return
1770 url = str(url).strip() # Remove leading and trailing whitespace
1771 if not page_utils.looks_like_a_page_url(url):
1772 if page_utils.is_valid_url("https://" + url):
1773 url = "https://" + url
1774 driver.get(url)
1775
1776
1777def click(driver, selector, by="css selector", timeout=settings.SMALL_TIMEOUT):

Callers

nothing calls this directly

Calls 5

disconnectMethod · 0.80
__is_cdp_swap_neededFunction · 0.70
openMethod · 0.45
is_valid_urlMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…