Home > Net >  Cannot grab text between span tags
Cannot grab text between span tags

Time:08-25

I am having a heck of a time grabbing text from the span tag (568,789,073,292). The text is constantly changing. See HTML below.

I thought this should work but its not

xpath=(//div[@id='RxValidPackets']/span)[3]

The elements below is from row 3 of a table.

When I try to grab row 6, I try this

xpath=(//div[@id='RxValidPackets']/span)[6]

There are 6 rows of data with the same elements. The only difference is the span tags.

Can you help?

Here is the HTML:

<td >
    <div id="RxValidPackets" >
        <span>568,789,073,292</span>
    </div>
</td>

CodePudding user response:

Make sure you don't use the same ID in every row. In an HTML document, IDs are unique.

CodePudding user response:

you can give individual ids in span tags

  • Related