seleniumbase / SeleniumBase

📊 Python's all-in-one framework for web crawling, scraping, testing, and reporting. Supports pytest. UC Mode provides stealth. Includes many tools.
https://seleniumbase.io
MIT License
4.45k stars 908 forks source link

--window-size Does Not Work for Driver initialization. #2872

Closed oniononion36 closed 6 days ago

oniononion36 commented 6 days ago

When I pass chromium_arg='--window-size=1000,1000' into Driver, the argument gets split up into --window-size=1000 and --1000, and is subsequently ignored at browser start up.

mdmintz commented 6 days ago

Window size can be set after the browser has been launched:

driver.set_window_size(1000, 1000)

Also, chromium_arg takes a comma-separated list of args, which means that individual args cannot contain commas.

PankajSavaliya commented 13 hours ago
  driver = Driver(uc=True, agent=generate_random_mobile_user_agent(False),
                    chromium_arg="--window-size:280,653")

@mdmintz I have set like above snippet even not set size, if I used

driver.set_window_size(1000, 1000)

then it's work but I want to set in chromium_arg, can you please give me a sample of how to set .