in reply to Re: scrape a webpage
in thread scrape a webpage

# ===== I'm using ===================== use WWW::Mechanize::Firefox qw(); use HTML::TreeBuilder::LibXML qw();

Replies are listed 'Best First'.
Re^3: scrape a webpage
by marto (Cardinal) on May 22, 2017 at 13:29 UTC

    Look at $mech->value(); from the WWW::Mechanize::Firefox documentation. You could have saved time by specifying these modules in your question.

      I read $mech->value() doc but still can't figure out what to do. If I don't "trim" $B, I get this printout: للللل4WD/AWD I'm lost.

        Maybe try $B->{value} then, but you will have to stay within the Firefox framework then and not use any other HTML thing like HTML::TreeBuilder::LibXML.

        If you have your tree already in HTML::TreeBuilder::LibXML, then use what the HTML::TreeBuilder::LibXML documentation suggests:

        my $value = $node->attr('value');