title: Python - Selenium - How to use Browser Shortcuts
body: <p>Once a browser page is loaded I'm looking to use the CRTL+P shortcut in Goggle Chrome to enter the print page and then simply press return to print the page.</p>
  
  <pre><code>import time
  from selenium import webdriver
  
  # Initialise the webdriver
  chromeOps=webdriver.ChromeOptions()
  chromeOps._binary_location = "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
  chromeOps._arguments = ["--enable-internal-flash"]
  browser = webdriver.Chrome("C:\\Program Files\\Google\\Chrome\\Application\\chromedriver.exe", port=4445, chrome_options=chromeOps)
  time.sleep(3)
  
  # Login to Webpage
  browser.get('www.webpage.com')
  </code></pre>
  
  <p>My question is how do I send keys to the browser itself rather than an element?</p>
  
  <p>Failed Attempt:  To assign the html body to as the element and send keys to that-</p>
  
  <pre><code>elem = browser.find_element_by_xpath("/html/body") # href link
  elem.send_keys(Keys.CONTROL + "P")      # Will open a second tab
  time.sleep(3)
  elem.send_keys(Keys.RETURN)
  </code></pre>