PART 2 : create a siimple python project to run selenium webdriver
1. create a new python file under the project. 在项目名称上右键新建python file,然后取一个file name.
2. copy the code into the python file
# -*- coding:utf-8 -*-
from selenium import webdriver
# create a new Firefox session
driver = webdriver.Firefox()
driver.implicitly_wait(10) # 设置超时时间
driver.maximize_window() # 窗口最大化显示
# navigate to the application home page
driver.get("http://www.baidu.com/")
# get the search textbox
search_field = driver.find_element_by_id("kw") # 找到输入框
search_field.clear() # 清空当前输入内容
# enter search keyword and submit
search_field.send_keys("Selenium2") # 重新这是搜索关键字
search_field.submit() # 提交进行搜索
# get all the anchor elements which have product names displayed
# currently on result page using fi