surfer190 surfer190 - 9 months ago 51
HTML Question

WWW::Mechanize::Firefox How do you extract the text within HTML element tags?

Good Day,

How do you print the text of an

tag with

I have tried:

print $_->text, '/n' for $mech->selector('td.dataCell');

print $_->text(), '/n' for $mech->selector('td.dataCell');

print $_->{text}, '/n' for $mech->selector('td.dataCell');

print $_->content, '/n' for $mech->selector('td.dataCell');

Remember I do not want
, but that does work btw.

print $_->{text}, '/n' for $mech->selector('td.dataCell');

The above line does work, but output is just multiple


The only solution I have is to use:

my $element = $mech->selector('td.dataCell');

my $string = $element->{innerHTML};

And then formatting the html within each dataCell