Пример #1
0
class Sousuojieguo():
    def __init__(self):
        self.driver = Login().driver

    def sousuojieguo(self, a):
        #当id,class相同时
        self.driver.find_elements_by_class_name("goodsimg")[a].click()
Пример #2
0
class Gouwuche():
    def __init__(self):
        self.driver = Login().driver

    def xiugai1(self):
        self.driver.find_elements_by_class_name("f6")[0].click()

    def xiugai2(self, mingzi, dizhi, tel, email, youbian, shoujihao):
        self.driver.find_elements_by_name("f6")[1].click()
        self.driver.find_element_by_name("consignee").send_keys(mingzi)
        self.driver.find_element_by_name("address").send_keys(dizhi)
        self.driver.find_element_by_name("tel").send_keys(tel)
        self.driver.find_element_by_name("email").send_keys(email)
        self.driver.find_element_by_name("zipcode").send_keys(youbian)
        self.driver.find_element_by_name("mobile").send_keys(shoujihao)
        self.driver.find_elements_by_class_name("bnt_blue_2")[0].click()

    def shiyongyue(self, a):
        self.driver.find_element_by_name("surplus").send_keys(a)

    def shiyongjifen(self, a):
        self.driver.find_element_by_name("integral").send_keys(a)

    def shiyonghongbao(self, a):
        self.driver.find_element_by_name("bonus_sn").send_keys(a)
        self.driver.find_element_by_name("validate_bonus").click()

    def dingdanfuyan(self, a):
        self.driver.find_element_by_name("postscript").send_keys(a)

    def peisongshifou(self):
        self.driver.find_element_by_name("need_insure").click()

    def tijiaodingdan(self):
        self.driver.find_element_by_xpath(
            "//*[@id=\"theForm\"]/div[11]/div[2]/input[1]").click()
Пример #3
0
class Gouwuche():
    def __init__(self):
        self.driver = Login().driver

    def shangpinmingcheng(self):
        a = self.driver.find_element_by_xpath(
            "//*[@id=\"formCart\"]/table[1]/tbody/tr[2]/td[1]/a[2]").text
        return a

    def shichangjia(self):
        a = self.driver.find_element_by_xpath(
            "//*[@id=\"formCart\"]/table[1]/tbody/tr[2]/td[3]").text
        return a

    def bendianjia(self):
        a = self.driver.find_element_by_xpath(
            "//*[@id=\"formCart\"]/table[1]/tbody/tr[2]/td[4]").text
        return a

    def xiugaishuliang(self, a):
        self.driver.find_elements_by_class_name("inputBg")[0].clear()
        self.driver.find_elements_by_class_name("inputBg")[0].send_keys(a)

    def dianjishanchu(self):
        self.driver.find_element_by_xpath(
            "//*[@id=\"formCart\"]/table[1]/tbody/tr[2]/td[7]/a[1]").click()

    def dianjifangrugouwuche(self):
        self.driver.find_element_by_xpath(
            "//*[@id=\"formCart\"]/table[1]/tbody/tr[2]/td[7]/a[2]")

    def qingkonggouwuche(self):
        self.driver.find_elements_by_class_name("bnt_blue_1")[0].click()

    def gengxingouwuche(self):
        self.driver.find_elements_by_class_name("bnt_blue_1")[1].click()

    def dianjijiesuan(self):
        self.driver.find_element_by_xpath(
            "/html/body/div[5]/div[1]/table/tbody/tr/td[2]/a/img").click()

    def dianjijixugouwu(self):
        self.driver.find_element_by_xpath(
            "/html/body/div[5]/div[1]/table/tbody/tr/td[1]/a/img").click()