I am trying to extract a text from <div>
, which is an inside double quote (refer Screenshot) with XPath
<div class="two columns" style="font-size: 18px; padding-top: 5px;">
<img src="images/spins_s.png" border="0" style="margin-bottom: -1px;">
5
</div>
I am attaching a screenshot here, [ https://i.stack.imgur.com/uOmeS.png][1] While i am trying this xpath expression in cole log its return correct o/p,
>>$x("//div[@class='two columns']/img[@src='images/spins_s.png']/..")[0].innerText
>>" 5"
But when I am going to run this code In python
spin_balance = browser.find_element_by_xpath("//div[@class='two columns']/img[@src='images/spins_s.png']/..")[0].innerText
it's giving error like this
spin_balance = browser.find_element_by_xpath("//div[@class='two columns']/img[@src='images/spins_s.png']/..")[0].innerText
TypeError: 'WebElement' object is not subscriptable
Image of HTML: