from selenium import webdriver # 成功导入第三方包
import time
from selenium.webdriver.common.action_chains import ActionChains
db = webdriver.Chrome() # 选择浏览器
db.get('http://www.testingedu.com.cn:8000/Home/User/index.html') # 打开网站的网址
db.get('http://www.testingedu.com.cn:8000/Home/User/index.html')
db.maximize_window() # 页面最大
input = db.find_element_by_id('username')
input.send_keys('13800138006')
input2 = db.find_element_by_id('password')
input2.send_keys('123456')
input3 = db.find_element_by_id('verify_code')
input3.send_keys('1234')
db.find_element_by_name('sbtbutton').click() # 登陆方法一
input4 = db.find_element_by_name('sbtbutton')
input4.click()
time.sleep(3)
shouye = db.find_element_by_css_selector('list-style: none outside none;')
index = db.find_element_by_link_text("首页").click()
shouye=db.find_element_by_xpath("//*[@id='navitems']/li[1]/a")
shouye.click()
emp = db.find_element_by_link_text('艺术鲜花').click()
emp1 = db.find_element_by_link_text('永生花').click()
emp0 = db.find_element_by_link_text('全部商品分类').click()
time.sleep(3)
emp = db.find_element_by_link_text('服装服饰').click()
time.sleep(3)
emp4 = db.find_element_by_link_text('男装').click()
time.sleep(3)
emp1 = db.find_element_by_link_text('西服套装').click()
time.sleep(3)
emp3 = db.find_element_by_xpath("/html/body/div[4]/div/div[2]/div[2]/ul/li/div/div[1]/a/img").click()
emp3 = db.
time.sleep(3)
emp2 = db.find_element_by_xpath("//*[@id='join_cart']") .click()