Suppose this is the dummy html code that I am accessing:
<ul class="some class">
<li id ="a">Arranged in any order</li>
<li id ="b" >Will still make sense</li>
</ul>
I am running a python script to automate a certain website and I need to extract all li tags from certain ul tag. I have extracted the ul tag using the xPath. When I try to print the ul using ul.text.
It prints:
Arranged in any order
Will still make sense
However I want the li tags along with the attributes like id. Is there any way in selenium to do this thing.
Desired output:
<li id ="a">Arranged in any order</li>
<li id ="b" >Will still make sense</li>