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

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

Replies are listed 'Best First'.
Re^4: scrape a webpage
by backyardbill (Initiate) on May 27, 2017 at 21:50 UTC

    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');