__author__ = ' jyd ' from selenium.webdriver.common.by import By # driver webdriver实例化对象 # element 查询元素的方法如id,name,xpath # value 元素的值 def find_element(driver,element,value): element = element.upper() element_type = getattr(By,element) element_object =driver.find_element(by=element_type,value= value) return element_object