0

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.

Xanya
  • 13
  • 3
  • The error can be ignored; see https://stackoverflow.com/questions/64927909/failed-to-read-descriptor-from-node-connection-a-device-attached-to-the-system. – bobtho'-' Mar 25 '23 at 01:41
  • Does this answer your question? [How to zoom out of page using python selenium](https://stackoverflow.com/questions/32135085/how-to-zoom-out-of-page-using-python-selenium) – bobtho'-' Mar 25 '23 at 01:42

0 Answers0