input: Write a function to implement a Selenium script in Python that automates the login process on the website 'www.example.com'. The function should initialize the web driver, navigate to the target website, locate and input the username and password, click the submit button, and then wait for the login process to complete. If the login is successful, print 'Login successful!'. Otherwise, handle any errors that may occur during the process.
  
  from selenium import webdriver
  from selenium.webdriver.common.keys import Keys
  import time
  
  def automate_login(username_input, password_input):
      # Initialize web driver
      driver = webdriver.Chrome()
  
      # Navigate to the target web page
      driver.get('http://www.example.com')
  
      # Locate username field
      username = driver.find_element_by_name('username')
  
      # Enter username
      username.send_keys(username_input)
  
      # Locate password field
      password = driver.find_element_by_name('password')
  
      # Enter password
      password.send_keys(password_input)
  
      # Locate submit button
      submit_button = driver.find_element_by_name('submit')
  
      # Click submit button
      submit_button.click()
  
      # Wait for login process to complete
      time.sleep(5)
  
      # Login successful
      print('Login successful!')
  
      driver.close()
  
  assert automate_login('user123', 'pass123')==None
  assert automate_login('wronguser', 'wrongpass')==None
  assert automate_login('', '')==None
output: def automate_login(username_input, password_input):
      driver = webdriver.Chrome()
      driver.get('http://www.example.com')
      username = driver.find_element_by_name('username')
      username.send_keys(username_input)
      password = driver.find_element_by_name('password')
      password.send_keys(password_input)
      submit_button = driver.find_element_by_name('submit')
      submit_button.click()
      time.sleep(5)
      print('Login successful!')
      driver.close()