undetected-chromedriver icon indicating copy to clipboard operation
undetected-chromedriver copied to clipboard

Can not change window size!

Open duongthiminhchau opened this issue 11 months ago • 2 comments

I use the following code but it doesn't work: chrome_options = uc.ChromeOptions() chrome_options.add_argument("--window-size=1280,720")

duongthiminhchau avatar Mar 12 '24 05:03 duongthiminhchau

Have you tried using driver.set_window_position(0, 0) to set window position (optional), and then driver.set_window_size(0, 0)?

opemvbs avatar Mar 12 '24 13:03 opemvbs

The windows override of the size option is hard coded in the init_.py file . No solution with the current version to use the --windows-size argument. For instance, the following will do nothing:

options = ChromeOptions()
options.add_argument("--window-size=1,1")

driver = uc.Chrome(
    options=options,  # options for the browser
)

There is a PR for that, see #1187

LaurentOngaro avatar Apr 05 '24 06:04 LaurentOngaro