Hi,
I'm trying to extract all name values in input fields using selenium and perl. Part of the value, enough to identify it, is known, the rest is unknown:
This xpath works in finding all relevant matches:
//tr/td//input[contains(@name,'partofname')]
So, in perl:
my $xpath = qq(//tr/td//input[contains(\@name,'partofname')]);
my $count = $sel->get_xpath_count($xpath);
Fine, $count gives a suitable count of matches.
However, how to extract the value of the @name attribute for each individual matches?
I understand the principle is to construct a loop:
foreach my $row (1 .. $count) {
#extract here
};
However, I can't seem to construct an xpath expression which will work to find each $row that the expression matched. So I think it's the correct xpath expression to get each individual match that I need help with.
Any pointers appreciated