I want the rating of this book which is mentioned in the name of class. So, how can I get that class name?
<p class ="star_rating five"> </p>
$prices = $xpath->evaluate('//ol[@class="row"]//li//article//div[@class="product_price"]//p[@class="price_color"]');
$rating =$xpath->evaluate('//ol[@class="row"]//li//article//p[@class]');
You can use the following example and it would work fine.
You can filter out the tags you want specifically & reach to the
node which contains your desired attribute, using
getAttributeyou can get the value provided in it.try above provided snippet: https://ideone.com/aG8DcN