Я новичок ie и в настоящее время работаю над извлечением некоторой информации с веб-сайта. Теперь у меня есть проблемы с получением текста из тега <aside
. Я получаю пустой результат. пожалуйста, помогите.
<aside class="ckdc-popup-wrapper meter-popup-wrapper recipe-energy-hover-wrapper" aria-hidden="true">
<div class="nutrient fiber"><span class="nutrient-title">Fiber:</span> <span class="nutrient-grams">0 g</span></div>
<div class="nutrient fat" aria-label="56 %"><span class="nutrient-title">Fat:</span> 56 % (<span class="nutrient-grams">29 g</span>)</div>
<div class="nutrient protein" aria-label="34 %"><span class="nutrient-title">Protein:</span> 34 % (<span class="nutrient-grams">40 g</span>)</div>
<div class="nutrient kcal"><span class="nutrient-title">kcal:</span> <span class="nutrient-grams">490</span></div>
</aside>
Это то, что я пробовал:
for b in page.find('aside',{'class':'ckdc-popup-wrapper meter-popup-wrapper recipe-energy-hover-wrapper'}):
print(b.text)
вот как
<aside aria-hidden="true" class="recipe-energy-mark-wrapper ckdc-js-popup" data-js-popup="<aside class="ckdc-popup-wrapper meter-popup-wrapper recipe-energy-hover-wrapper" aria-hidden="true"><span class="ckdc-popup"><span class="ckdc-popup-inner"><span class="ckdc-popup-header"><span class="js-link" data-href="https://www.dietdoctor.com/how-low-carb-is-low-carb" title="Learn more about low carb strictness">Moderate low carb</span><p>Per serving</p></span><svg viewBox="0 0 32 32" class="nutrients-chart"><circle r="16" cx="16" cy="16" stroke-dasharray="101 100" class="fat"><title>Fat 56.324679651686%</title></circle><circle r="16" cx="16" cy="16" stroke-dasharray="43.675320348314 100" class="protein"><title>Protein 56.324679651686%</title></circle><circle r="16" cx="16" cy="16" stroke-dasharray="9.5141604591551 100" class="carbs"><title>Calories 9.5141604591551%</title></circle></svg><div class="nutrient carbs" aria-label="10 %"><span class="nutrient-title">Net carbs:</span> 10 % (<span class="nutrient-grams">11 g</span>)</div><div class="nutrient fiber"><span class="nutrient-title">Fiber:</span> <span class="nutrient-grams">0 g</span></div><div class="nutrient fat" aria-label="56 %"><span class="nutrient-title">Fat:</span> 56 % (<span class="nutrient-grams">29 g</span>)</div><div class="nutrient protein" aria-label="34 %"><span class="nutrient-title">Protein:</span> 34 % (<span class="nutrient-grams">40 g</span>)</div><div class="nutrient kcal"><span class="nutrient-title">kcal:</span> <span class="nutrient-grams">490</span></div><div class="nutrient notice">We don\'t recommend counting calories. <a href="https://www.dietdoctor.com/low-carb/calories" target="_blank">Here\'s why.</a></div><div class="nutrient notice discrete">Nutritional information based on the USDA National Nutrient Database. <a href="https://www.dietdoctor.com/low-carb/recipes/faq#10" target="_blank">Read more</a></div><span class="fix"></span></span></span></aside>" role="note" title="">
Здесь представлены все необходимые детали