from selenium import webdriver
from time import sleep
from selenium.webdriver.support.select import Select
from selenium.webdriver.common.by import By
driver = webdriver.Firefox()
driver.get("http://localhost/v0.5.5/index.php?m=user&a=login")
# 定位下拉列表
locator = driver.find_element_by_id("industry")
#为下拉列表赋值
Select(locator).select_by_value("对外贸易")
province = driver.find_element_by_name("address['state']")
Select(province).select_by_visible_text("四川省")
city = driver.find_element_by_name("address['city']")
Select(city).select_by_index(1)
area = driver.find_element_by_name("address['area']")
Select(area).select_by_value("金牛区")
引入Select类
fro