title: Selenium code in python to fill form after a login page
body: <p>Hi so I was designing a python script in selenium that will run fill up a form after login request.
  I have been able to fill in my login details and then click on "Submit" after which the browser closes itself automatically.
  here is the code which I used to login.</p>
  
  <pre><code>from selenium import webdriver
  from selenium.webdriver.common.keys import Keys
  from selenium.webdriver.support import ui
  
  def page_is_loaded(driver):
      return driver.find_element_by_tag_name("body") != None
  
  driver = webdriver.Firefox()
  driver.get("http://www.example.com")
  
  wait=ui.WebDriverWait(driver,10)
  wait.until(page_is_loaded)
  
  USERNAME = driver.find_element_by_xpath("/html/body/form/center/div[2]/table/tbody/tr[2]/td/table/tbody/tr[1]/td[2]/input")
  USERNAME.send_keys("alberteinstein")
  
  PASSWORD = driver.find_element_by_xpath("/html/body/form/center/div[2]/table/tbody/tr[2]/td/table/tbody/tr[2]/td[2]/input")
  PASSWORD.send_keys("IamHISson")
  
  Login_Button=driver.find_element_by_xpath("/html/body/form/center /div[2]/table/tbody/tr[3]/td/div/input")
  Login_Button.click()
  </code></pre>
  
  <p>after this piece of code there is a form which needs to be filled.</p>
  
  <p>I can write a code to fill in the form, the problem is how to make selenium wait until the next page loads and also do I need to provide the link of the next page ?</p>