标签:comm 艺术 art sleep send home tar driver max
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.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‘)
input4 = db.find_element_by_name(‘sbtbutton‘)
input4.click()
time.sleep(3)
index = 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()
time.sleep(3)
emp2 = db.find_element_by_xpath("//*[@id=‘join_cart‘]") .click()
标签:comm 艺术 art sleep send home tar driver max
原文地址:https://www.cnblogs.com/Swx1030/p/14157320.html