I wanted to zoom out a page right after I load that page but doesn't work. Here's a code:
import os
import time
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
chrome_options = Options()
chrome_options.add_experimental_option("detach", True)
driver = webdriver.Chrome(chrome_options=chrome_options)
driver.get('https://www.namecheap.com/domains/whois/')
div = driver.find_element(By.TAG_NAME, "html")
div.send_keys(Keys.CONTROL, Keys.ADD)
Also I get this error everytime the code runs:
Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
I tried ActionChains as well and that didn't work either. The following solution is not what I want btw
driver.execute_script("document.body.style.zoom='zoom %'")
I want to zoom using Keys actions.