Can we Zoom the browser window in python selenium webdriver?

I was just struggling with this. I managed to find something that works for me, hopefully it works for you:

driver.execute_script("document.body.style.zoom='zoom %'")

Have ‘zoom%’ = whatever zoom level you want. (e.g. ‘67%’)

Leave a Comment