I'm trying to change the zoom in Chrome programmatically. I tried using Python to do this
driver.execute_script("document.body.style.zoom='zoom %'")
But this makes it zoom in CSS, not Chrome itself. How can I affect Chrome's zoom?
I'm trying to change the zoom in Chrome programmatically. I tried using Python to do this
driver.execute_script("document.body.style.zoom='zoom %'")
But this makes it zoom in CSS, not Chrome itself. How can I affect Chrome's zoom?
The possible solution is:
html = driver.find_element_by_tag_name("html")
# reduce zoom
html.send_keys(Keys.CONTROL, Keys.SUBTRACT)
# increment zoom
html.send_keys(Keys.CONTROL, Keys.ADD)
driver.execute_script("document.body.style.zoom='75%'")