Я пытаюсь проверить, существует ли class = "special-price" в приведенном ниже коде.Вот HTML-код:
<div class="product-shop">
<div class="f-fix">
<h2 class="product-name newname"> <a href="#" title=""> Xiaomi Mi Band 2 Strap (Black with White Border) </a></h2>
<!--product price-->
<div class="text-center ">
<div class="price-box">
<p class="old-price"> <span class="price-label">Regular Price:</span >
<span class = "price" id = "old-price-8846" > ৳200 </span>
</p >
<p class = "special-price" >
<span class = "price-label"> Special Price </span>
<span class="price" itemprop="price" content="149" id="product-price-8846"> ৳149 </span>
</p>
</div>
</div >
</div>
Я использую Scrapy с Python.После проверки, найден ли класс, мне нужно собрать текст class = "price" .