Issue
Having done research on selecting an html element of a given class, I'm stuck being
unable to select a table
element with a class named "treasuries-table"
from https://www.buybitcoinworldwide.com/treasuries/. I've noticed that there is
<table class="treasuries-index treasuries-table treasuries-table--smaller">
on the page but it is not my target, only
<table class="treasuries-table">
is. I've tried
//table[contains(concat(" ", normalize-space(@class), " "), " treasuries-table ")]
as well as the less verbose, but not necessarily correct,
//table[@class="treasuries-table"]
, all this to no avail.
Where am I wrong? I usually try first to find elements with this online tester, might it be the tester's fault?
P.S. Apologies if it does seem as a duplicate but the solutions mentioned in similar questions does not seem to work for me.
Solution
Actually,'//table[contains(@class,"treasuries-table")]'
is selecting 5 tables but '//table[@class="treasuries-index treasuries-table treasuries-table--smaller")]' is selecting the first table which is equivalent to (//table[contains(@class,"treasuries-table")])[1]
Try:
'//table[contains(@class,"treasuries-table")]'
Answered By - F.Hoque
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.