kevyt has asked for the wisdom of the Perl Monks concerning the following question:
I am able to get the web page into the program by doing this:<div class=\042mytitle maximumtitle\042 id=\042idtitle\042> Harry Jone +s <b>Wood </b> & Shop</div> latlng=56789904,-938882991,3132132133321 & <div class=\042address\042 id=\042idaddr\042>737373 Smith Rd<br/>New Y +ork, NY 14254<br/></div><div class=\042 </div><div class=\042phone\042>(154) 555-1234 - <span style= +\042display:none\042 class=\042my_hide\042>
I have tried methods find->tag and otehrs and I am not getting anywhere. I also found a post on perlmonks regarding parsing and I edited the line fro mthe posting and tried this:my $url = 'http://www.somepage.com'; # $browser->cookie_jar({}); #### use if the site requires cookies my $browser = LWP::UserAgent->new; my @ns_headers = ( 'User-Agent' => 'Mozilla/4.76 [en] (Win98; U)', 'Accept' => 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*', 'Accept-Charset' => 'iso-8859-1,*,utf-8', 'Accept-Language' => 'en-US', ); my $response = $browser->get( $url, @ns_headers); die "Can't get $url -- ", $response->status_line unless $response->is_success; die "Hey, I was expecting HTML, not ", $response->content_type unless $response->content_type eq 'text/html';
Can you please help? Thanks@addr = $response->content =~ /<div class=\042mytitle maximumtitle\042 + id=\042idtitle\042>"([^ "]+)"/gi;
|
|---|