# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary


def main():
    binary = FirefoxBinary('C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe')
    browser = webdriver.Firefox(firefox_binary=binary)

    browser.get('http://www.baidu.com')
    # assert '百度一下，你就知道' in browser.title

    elem = browser.find_element_by_id('kw')  # Find the search box
    elem.send_keys('seleniumhq' + Keys.RETURN)

    # browser.quit()


if __name__ == '__main__':
    browser = webdriver.Ie()

    browser.get('http://www.baidu.com')
    # assert '百度一下，你就知道' in browser.title

    elem = browser.find_element_by_id('kw')  # Find the search box
    elem.send_keys('seleniumhq' + Keys.RETURN)
