Skip to main content


I am using Selenium to obtain a numeric value from a website with code such as:

my @divwrap = $driver->find_elements('whatever', 'id'); my $return_value = $driver->find_child_element($divwrap, 'changeValue', 'class')->get_text(); 

This works fine, and returns the correct expected value.

If the value is POSITIVE, it return the plus sign, such as "+64.43"

But if the value is NEGATIVE, it returns a "wide Character" string: "" instead of the minus sign.

So the return looks like "64.43"

Interestingly, I cannot do a substitution.

If I have explicit code, such as:

my $output = "64.43" ; $output =~ s/"/\-/ ; 

... then $output will print as "-64.43"

... but if I try to do the same substitution on the return from the find_child_element function:

$return_value =~ s/"/\-/ ; 

... the substitution does not take... and printing $return_value continues to output "64.43".

Any ideas why it doesn't... and how to solve it?

submitted by /u/AvWxA
[link] [comments]