Skip to content

Commit bdc8521

Browse files
authored
Merge pull request #3950 from seleniumbase/proxy-with-user-no-pass
Allow proxy auth with user but no pass
2 parents b878608 + a35aabb commit bdc8521

File tree

6 files changed

+48
-7
lines changed

6 files changed

+48
-7
lines changed

examples/cdp_mode/raw_indeed_login.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""An example of clicking at custom CAPTCHA coordinates."""
2+
from seleniumbase import SB
3+
4+
with SB(uc=True, test=True, locale="en") as sb:
5+
url = "https://www.indeed.com/"
6+
sb.activate_cdp_mode(url)
7+
sb.sleep(1)
8+
sb.click('[data-gnav-element-name="SignIn"] a')
9+
sb.uc_gui_click_captcha()
10+
sb.type('input[type="email"]', "[email protected]")
11+
sb.sleep(1)
12+
sb.click('button[type="submit"]')
13+
sb.sleep(3.5)
14+
selector = 'div[class*="pass-Captcha"]'
15+
element_rect = sb.cdp.get_gui_element_rect(selector, timeout=1)
16+
x = element_rect["x"] + 32
17+
y = element_rect["y"] + 44
18+
sb.cdp.gui_click_x_y(x, y)
19+
sb.sleep(4.5)

examples/raw_no_context_mgr.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""SB() without the context manager `with` block."""
2+
from seleniumbase import SB
3+
4+
sb_context = SB()
5+
sb = sb_context.__enter__()
6+
sb.open("data:text/html,<h1>Test Page</h1>")
7+
sb.highlight("h1", loops=8)
8+
sb_context.__exit__(None, None, None)
9+
10+
"""Same example using `with`:
11+
from seleniumbase import SB
12+
13+
with SB() as sb:
14+
sb.open("data:text/html,<h1>Test Page</h1>")
15+
sb.highlight("h1", loops=8)
16+
"""

requirements.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ pytest-xdist==3.6.1;python_version<"3.9"
6666
pytest-xdist==3.8.0;python_version>="3.9"
6767
parameterized==0.9.0
6868
behave==1.2.6
69-
soupsieve==2.7
70-
beautifulsoup4>=4.13.5,<4.14
69+
soupsieve==2.7;python_version<"3.9"
70+
soupsieve~=2.8;python_version>="3.9"
71+
beautifulsoup4~=4.13.5
7172
pyotp==2.9.0
7273
python-xlib==0.33;platform_system=="Linux"
7374
markdown-it-py==3.0.0;python_version<"3.10"

seleniumbase/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# seleniumbase package
2-
__version__ = "4.41.2"
2+
__version__ = "4.41.3"

seleniumbase/core/browser_launcher.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3137,7 +3137,9 @@ def get_driver(
31373137
proxy_string, proxy_scheme = proxy_helper.validate_proxy_string(
31383138
proxy_string, keep_scheme=True
31393139
)
3140-
if proxy_string and proxy_user and proxy_pass:
3140+
if proxy_user and not proxy_pass:
3141+
proxy_pass = ""
3142+
if proxy_string and proxy_user:
31413143
proxy_auth = True
31423144
elif proxy_pac_url:
31433145
username_and_password = None
@@ -3164,7 +3166,9 @@ def get_driver(
31643166
)
31653167
if not proxy_pac_url.lower().endswith(".pac"):
31663168
raise Exception('The proxy PAC URL must end with ".pac"!')
3167-
if proxy_pac_url and proxy_user and proxy_pass:
3169+
if proxy_user and not proxy_pass:
3170+
proxy_pass = ""
3171+
if proxy_pac_url and proxy_user:
31683172
proxy_auth = True
31693173
if (
31703174
is_using_uc(undetectable, browser_name)

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,9 @@
214214
'pytest-xdist==3.8.0;python_version>="3.9"',
215215
'parameterized==0.9.0',
216216
"behave==1.2.6", # Newer ones had issues
217-
'soupsieve==2.7',
218-
"beautifulsoup4>=4.13.5,<4.14",
217+
'soupsieve==2.7;python_version<"3.9"',
218+
'soupsieve~=2.8;python_version>="3.9"',
219+
"beautifulsoup4~=4.13.5",
219220
'pyotp==2.9.0',
220221
'python-xlib==0.33;platform_system=="Linux"',
221222
'markdown-it-py==3.0.0;python_version<"3.10"',

0 commit comments

Comments
 (0)