0

Please somebody should help me, i am working on program and i need to change the resolution and not to Resize my browser.. i have used all the solutions i can get online but none seems to satisfy my need. Below is my code

import seleniumwire.undetected_chromedriver as uc

options = Options()
options.add_argument("window-size=1400,600")
driver = uc.Chrome(use_subprocess=True,seleniumwire_options=options)
url = 'https://toolbox.googleapps.com/apps/browserinfo/'
driver.get(url)

The Above can only change the size of the browser and not the Resolution, when you visit the site above the main resolution will still be showing.

  • 1
    your screen resolution has nothing to do with the browser, thus you selenium will not help you with this. You can find plenty of solutions on how to change the resolution with python. Here is one [link](https://stackoverflow.com/questions/51987408/programmatically-change-windows-resolution) for example – chitown88 Sep 02 '22 at 13:48
  • Does this answer your question? [Changing Screen Resolution of Computer using python](https://stackoverflow.com/questions/54261812/changing-screen-resolution-of-computer-using-python) – chitown88 Sep 02 '22 at 13:49
  • No, it didnt, but thanks for your contribution – chibuike ogodo Sep 02 '22 at 13:54
  • Or do you mean how to zoom? read [here](https://stackoverflow.com/questions/15024756/selenium-webdriver-zoom-in-out-page-content) – chitown88 Sep 02 '22 at 14:01
  • When you visit this page https://toolbox.googleapps.com/apps/browserinfo/, you will see the resolution of your device. Am using selenium, so i want to change...i can only resize my browser but can't its resolution. i know resolution doesn't have anything to do with browser but yet, i want to know if its possible to change it with selenium python – chibuike ogodo Sep 02 '22 at 14:08
  • for me `"screen resolution"` rather mean `"dots per inch"` and you ask for `"screen size"` . [Your page](https://toolbox.googleapps.com/apps/browserinfo/) probably gets screen size using `window.screen.width, window.screen.height` in `JavaScript` but these values are `read-only`. You can't change it. See doc: [Screen.width - Web APIs | MDN](https://developer.mozilla.org/en-US/docs/Web/API/Screen/width) – furas Sep 02 '22 at 17:49

0 Answers0