title: Maximize WebDriver (Selenium 2) in Python
body: <p>I'm attempting to write a simple script that checks if I have any gmail emails labeled SOMETHING and then opens a firefox browser window to a login page, after which it goes to something else. </p>
  
  <p>Here's what I'm doing: </p>
  
  <pre><code>from selenium import webdriver
  from selenium.webdriver.support.ui import WebDriverWait
  from selenium.common.exceptions import TimeoutException
  from selenium.webdriver.common.action_chains import ActionChains
  import time, imaplib
  
  Eusername = "someone@gmail.com"
  Epassword = "password1"
  
  username = "username"
  password = "password2"
  
  imaps = imaplib.IMAP4_SSL('imap.gmail.com','993')
  imaps.login(Eusername,Epassword)
  
  imaps.select('SOMETHING')
  status, response = imaps.status('SOMETHING', "(UNSEEN)")
  unreadcount = int(response[0].split()[2].strip(').,]'))
  
  while unreadcount &gt; 0:
      driver = webdriver.Firefox()
      driver.get('http://wwww.SomeURL.com/some_login.html')
      time.sleep(3)
      inputElement = driver.find_element_by_name("user")
      inputElement.send_keys(username)
      inputElement = driver.find_element_by_name("pw")
      inputElement.send_keys(password)
      inputElement.submit()
      time.sleep(1)
      driver.get('http://www.SomeURL.com/somethingelse.html')
      imaps.select('SOMETHING')
      typ ,data = imaps.search(None,'UnSeen')
      imaps.store(data[0].replace(' ',','),'+FLAGS','\Seen')
  </code></pre>
  
  <p>I've spent hours search and haven't found a solution to maximize the browser window. Elsewhere i've read that there is a windowMaximize() or window_maximize(), but have not been able to get them to work since every configuration I've tried claims it doesn't exist for whatever module.</p>
  
  <p>I only know a little python, and am working in Mac OSX</p>