Skip to content

UC + CDP - Timezone config reset after element not found? #3765

Closed
@alerodm

Description

@alerodm

Hey! So I have the python snippet below which I was using to test the timezone override.

with SB(uc=True, test=False, locale_code="en-US") as sb:
    sb.activate_cdp_mode("https://ipwhois.io/", timezone="America/Chicago")
    print(sb.cdp.evaluate("return Intl.DateTimeFormat().resolvedOptions().timeZone;"))
    try:
        print(sb.cdp.find_element("div[class='foo']").text)  # non-existent element
    except Exception:
        pass
    print(sb.cdp.evaluate("return Intl.DateTimeFormat().resolvedOptions().timeZone;"))

When the element is found I have no issues:

America/Chicago
IP Geolocation API
America/Chicago

However, when the element isn't found the timezone override seems to have been reset?

> uv run sb_timezone.py
America/Chicago
America/Buenos_Aires

Currently on seleniumbase==4.38.2 and Chrome 136.

Am I missing any steps? Thanks

Metadata

Metadata

Assignees

Labels

UC Mode / CDP ModeUndetected Chromedriver Mode / CDP ModebugUh oh... Something needs to be fixed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions