I have the following code:
<div class="ProductSize-group"> <div class="c-form-field c-form-field--radio c-form-field--disabled c-form-field--unavailable ProductSize"><label for="input_radio_size_060" aria-hidden="true" class=""><span class="c-form-label-content">06.0</span></label><input name="size" aria-label="Size 06.0, out of stock" id="input_radio_size_060" type="radio" disabled="" required="" value="06.0"></div> <div class="c-form-field c-form-field--radio c-form-field--disabled c-form-field--unavailable ProductSize"><label for="input_radio_size_065" aria-hidden="true" class=""><span class="c-form-label-content">06.5</span></label><input name="size" aria-label="Size 06.5, out of stock" id="input_radio_size_065" type="radio" disabled="" required="" value="06.5"></div> </div> This is just part of it. I need to check if this div contains class
<div class="c-form-field c-form-field--radio c-form-field--disabled c-form-field--unavailable ProductSize"> Specifically check if this div contains class c-form-field--unavailable
This is what I have:
const productSizeOptions = await page.$(".ProductSize-group"); productSizeOptions.map(productSizeOption => { }) But I can't figure out how to loop through each class to see if it exists in the element or not. Any ideas?