コード例 #1
0
    def get_normal_price(self, product_element: element) -> float:
        priceStr = product_element.select_one(
            ".price-box .old-price span.price-old")
        if priceStr is None:
            priceStr = product_element.select_one(
                ".price-box .regular-price span.price")

        if priceStr:
            return float(self.parse_price(priceStr.text))

        return None
コード例 #2
0
 def get_status(self, product_element: element) -> int:
     button = product_element.select_one(
         "div.salesperson-category-products li.first div.actions div.add-to-cart button.btn-cart"
     )
     return button is not None
コード例 #3
0
 def get_offer_price(self, product_element: element) -> float:
     priceStr = product_element.select_one(
         ".price-box p.special-price span.price")
     if priceStr:
         return float(self.parse_price(priceStr.text))
     return None