'How to get value of nested class with Selenium Python
Hello i have problem i don't know how to get value of offer__name and offer_price.
<div class="offer">
<div class="offer__name">
<em> item1 </em>
<em> description of item1 </em>
</div>
<div class="offer__price">500</div>
</div>
<div class="offer">
<div class="offer__name">
<em> item2 </em>
<em> description of item2 </em>
</div>
<div class="offer__price">200</div>
</div>
<div class="offer">
<div class="offer__name">
<em> item3 </em>
<em> description of item3 </em>
</div>
<div class="offer__price">100</div>
</div>
i try with
objects = driver.findElement(By.xpath("//*[@class='offer']")));
for offer in objects:
...
but for-loop get me notice that object can't be iterated, can you help me?
I just want value like: item1 description of item1 500, item2 description of item2 200, item3 description of item3 100,
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
