I am trying to scrape the data from paytm web page using python BeautifulSoup https://paytm.com/shop/p/masha-mauve-satin-nighty-WNIGHW000NT14_45BBPPFR?src=search-grid&tracker=autosuggest%7Cundefined%7Cmasha%20nighty%7Cgrid%7CSearch%7C1. I am able to scrap all those fields which are using direct class names but some fields are using angularjs attributes and I don't have any idea how to do that.
I know how to scrape data of a span with defined class:-
mrp = link_soup.find_all("span" , class_="price")[0].string.strip()
But don't know how to do the same for the mentioned code.
Code from which I want to scrape data:-
<span ng-if="!product.product.isOnlyCarCategory">Buy for Rs 329</span>
I want to scrape number 329 from this span.
Whole Code:-
<div itemprop="offers" itemscope="itemscope" itemtype="https://schema.org/Offer" class="buy-bar">
<button class="md-raised fl md-button md-default-theme" ng-transclude="" type="button" ng-show="!product.product.notSellable && !product.product.preorder" ng-click="product.buyProduct();_gaq.push(['_addTrans','3523347','Bboy Body Wears', '329','', '0', '', '', 'India'])" ng-class="{'dealBtn' : product.product.vertical_id == 5 ,'cartupdating' : product.isCartUpdating }" ng-disabled="product.isCartUpdating || !product.product.instock" tabindex="0" aria-hidden="false" aria-disabled="false"><span ng-show="!product.product.add_qty_using_price && product.product.vertical_id !=5" aria-hidden="false">
<span ng-if="!product.product.isOnlyCarCategory">Buy for Rs 329</span>
<meta itemprop="price" content="">
<div>
<span ng-show="product.product.actual_price != product.product.offer_price" class="strike" aria-hidden="false">Rs. 749</span><span ng-show="product.product.actual_price != product.product.offer_price" aria-hidden="false" class=""> | 56% Discount</span></div>
<meta itemprop="pricecurrency" content="INR"></span><span ng-show="!product.product.add_qty_using_price && product.product.vertical_id ==5" aria-hidden="true" class="ng-hide"><span> Buy for Rs.329</span>
<meta itemprop="price" content="">
<div><span ng-show="product.product.attributes.deal_mrp" class="strike ng-hide" aria-hidden="true">Rs. </span><span ng-show="product.product.attributes.discounted_MRP" aria-hidden="true" class="ng-hide"> | Pay at store ~ Rs. </span><span ng-show="product.product.attributes.discount_perc" aria-hidden="true" class="ng-hide"> | Saving upto %</span></div>
<meta itemprop="pricecurrency" content="INR"></span><span ng-show="product.add_qty_using_price" aria-hidden="true" class="ng-hide"><span class="text"></span></span></button>
<button class="md-raised fl md-button md-default-theme ng-hide" ng-transclude="" type="button" ng-show="!product.product.notSellable && product.product.preorder" ng-click="product.buyProduct();_gaq.push(['_addTrans','3523347','Bboy Body Wears', '329','', '0', '', '', 'India'])" ng-class="product.isCartUpdating ? 'cartupdating': ''" ng-disabled="product.isCartUpdating || !product.product.instock ? "disabled": """ tabindex="0" aria-hidden="true" aria-disabled=""><span>Preorder Now For Rs. 329
<meta itemprop="price" content="329">
<div><span ng-show="product.product.actual_price != product.product.offer_price" class="strike" aria-hidden="false">Rs. 749</span><span ng-show="product.product.actual_price != product.product.offer_price" aria-hidden="false" class=""> | 56% Discount</span></div>
<meta itemprop="pricecurrency" content="INR"></span></button>
<div ng-show="product.product.notSellable" class="md-button md-raised fr ng-hide" aria-hidden="true"><a ng-href="" target="_blank"><span class="text"></span></a></div>
</div>
Is there any solution ?