Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: scrape a webpage

by marto (Cardinal)
on May 22, 2017 at 04:49 UTC ( [id://1190831]=note: print w/replies, xml ) Need Help??


in reply to scrape a webpage

You haven't specified what you're using to parse the HTML, here is an example using Mojo::DOM:

#!/usr/bin/perl use strict; use warnings; use Mojo::DOM; my $html = '<td class="fex_standardblack_font_small" bgcolor="white"> <input id="chkEquipment" name="chkEquipment" value="72" type="checkbox +"> 4WD/AWD </td>'; my $dom = Mojo::DOM->new( $html ); print $dom->at('#chkEquipment')->val;

The module is well documented. If this isn't what you're looking for you may need to ask a better question. How do I post a question effectively?.

Replies are listed 'Best First'.
Re^2: scrape a webpage
by Anonymous Monk on May 22, 2017 at 13:00 UTC
    # ===== I'm using ===================== use WWW::Mechanize::Firefox qw(); use HTML::TreeBuilder::LibXML qw();

      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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1190831]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-16 06:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found