I got the attribute value 232 from the below code
$_product->getData('farben');
How I get its label from this value?
Please try this code
Step 1)First you have to load the products
$_productCollection = $block->getLoadedProductCollection();
Step 2)In the product listing page ,there will be a foreach loop for listing the products like this
foreach ($_productCollection as $_product)
Step3)Your code will be inside this loop.Place the below code at a place whereever you want to display the attribute label.
$_product->getResource()->getAttribute('your_attribute_code')->getFrontend()->getValue($_product);
Just replace your_attribute_code with whatever your attribute is named.
Try this
<?php $_product = $block->getProduct(); ?>
<?php if (null !== $_product->getCustomAttribute('attribute_code')): ?>
<?= $_product->getAttributeText('attribute_code'); ?>
<?php endif; ?>
$passing_marks = $_product->getResource()->getAttribute('attribute_code');
$passing_marks->getFrontend()->getLabel($_product);