kaliiiiiiiiii / Selenium-Profiles

undetected Selenium using chromedriver and emulation / device profiles
Other
255 stars 29 forks source link

[feature request] dynamic Window Size #71

Closed mzcoder-hub closed 11 months ago

mzcoder-hub commented 11 months ago

i already setting the option proxy and the window size but its not work, and the chrome browser is still on the full size

profile = profiles.Windows()  # or .Android()
profile["proxy"] = {"proxy": "http://xxx:xxx@xxx:xxx"}
options = webdriver.ChromeOptions()
options.add_argument("--window-size=500,1079")
with Chrome(profile, options=options, uc_driver=True) as driver:
    print("Checking Proxy...")
    driver.get("https://api.myip.com/")
    time.sleep(5)
    print("Proxy OK")
    print("Starting Login...")

what should i do to make the window-size is like on the setting ?

kaliiiiiiiiii commented 11 months ago

Indeed, that's a bug within undetected-chromdriver https://github.com/ultrafunkamsterdam/undetected-chromedriver/issues/1100

Without you can patch that using https://stackoverflow.com/a/55016352/20443541 Actually, might implement dynamic window size:)

kaliiiiiiiiii commented 11 months ago

@mzcoder-hub should now be resolved with selenium-profiles>=2.2.7.4

you can set profile["cdp"]["emulation"]["width"] and profile["cdp"]["emulation"]["height"] setting the screen size