Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions examples/cdp_mode/raw_indeed_login.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""An example of clicking at custom CAPTCHA coordinates."""
from seleniumbase import SB

with SB(uc=True, test=True, locale="en") as sb:
url = "https://www.indeed.com/"
sb.activate_cdp_mode(url)
sb.sleep(1)
sb.click('[data-gnav-element-name="SignIn"] a')
sb.uc_gui_click_captcha()
sb.type('input[type="email"]', "[email protected]")
sb.sleep(1)
sb.click('button[type="submit"]')
sb.sleep(3.5)
selector = 'div[class*="pass-Captcha"]'
element_rect = sb.cdp.get_gui_element_rect(selector, timeout=1)
x = element_rect["x"] + 32
y = element_rect["y"] + 44
sb.cdp.gui_click_x_y(x, y)
sb.sleep(4.5)
16 changes: 16 additions & 0 deletions examples/raw_no_context_mgr.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""SB() without the context manager `with` block."""
from seleniumbase import SB

sb_context = SB()
sb = sb_context.__enter__()
sb.open("data:text/html,<h1>Test Page</h1>")
sb.highlight("h1", loops=8)
sb_context.__exit__(None, None, None)

"""Same example using `with`:
from seleniumbase import SB
with SB() as sb:
sb.open("data:text/html,<h1>Test Page</h1>")
sb.highlight("h1", loops=8)
"""
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ pytest-xdist==3.6.1;python_version<"3.9"
pytest-xdist==3.8.0;python_version>="3.9"
parameterized==0.9.0
behave==1.2.6
soupsieve==2.7
beautifulsoup4>=4.13.5,<4.14
soupsieve==2.7;python_version<"3.9"
soupsieve~=2.8;python_version>="3.9"
beautifulsoup4~=4.13.5
pyotp==2.9.0
python-xlib==0.33;platform_system=="Linux"
markdown-it-py==3.0.0;python_version<"3.10"
Expand Down
2 changes: 1 addition & 1 deletion seleniumbase/__version__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# seleniumbase package
__version__ = "4.41.2"
__version__ = "4.41.3"
8 changes: 6 additions & 2 deletions seleniumbase/core/browser_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -3137,7 +3137,9 @@ def get_driver(
proxy_string, proxy_scheme = proxy_helper.validate_proxy_string(
proxy_string, keep_scheme=True
)
if proxy_string and proxy_user and proxy_pass:
if proxy_user and not proxy_pass:
proxy_pass = ""
if proxy_string and proxy_user:
proxy_auth = True
elif proxy_pac_url:
username_and_password = None
Expand All @@ -3164,7 +3166,9 @@ def get_driver(
)
if not proxy_pac_url.lower().endswith(".pac"):
raise Exception('The proxy PAC URL must end with ".pac"!')
if proxy_pac_url and proxy_user and proxy_pass:
if proxy_user and not proxy_pass:
proxy_pass = ""
if proxy_pac_url and proxy_user:
proxy_auth = True
if (
is_using_uc(undetectable, browser_name)
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,9 @@
'pytest-xdist==3.8.0;python_version>="3.9"',
'parameterized==0.9.0',
"behave==1.2.6", # Newer ones had issues
'soupsieve==2.7',
"beautifulsoup4>=4.13.5,<4.14",
'soupsieve==2.7;python_version<"3.9"',
'soupsieve~=2.8;python_version>="3.9"',
"beautifulsoup4~=4.13.5",
'pyotp==2.9.0',
'python-xlib==0.33;platform_system=="Linux"',
'markdown-it-py==3.0.0;python_version<"3.10"',
Expand Down