Hi all,

I have a a file of serial numbers for machines that I need to determine the warranty status of, as well as the model.
The serial numbers are in a file which looks like this:
13XGK4J 9KJDK4J CNOR665J74445994CNTS 3RT1K4J
called serials.txt
Essentially I am searching each machine and retrieving the information on the model which exists in the meta-data at the start of the HTML as follows:
use strict; use warnings; use LWP::Simple; use Data::Dumper; use HTML::HeadParser; #use HTML::Miner; #use HTML::Tree; my $URL; my $head; open (DELLSERIALS, 'serials.txt'); while (<DELLSERIALS>) { chomp; print "<<<Now checking $_>>>\n"; my $funky = "http://www.dell.com/support/troubleshooting/ed/en/edb +sdt1/Servicetag/" . $_; $URL = get("$funky"); $head = HTML::HeadParser->new; $head->parse("$URL"); # print Dumper($head); print $head->header('x-meta-supportservicetag') . "\n"; print $head->header('x-meta-supportproductcode') . "\n"; } close (DELLSERIALS);

The problem I have now is in getting that warranty information, and some machines have more than one warranty, from somewhere in the middle of the HTML although in the rendering of the page it is shown in the block to the right.
For each serial number I need the Next Business Day and the date (e.g. 11/12/2012) which are in bold in a hash or an array, something like:
$VAR1 = { 'warranty' => {'NBD ProSupport for Enterprise' => '02/12/201 +2', 'Next Business Day' => '02/12/2012' }, 'model' => 'Latitude E6500', 'serial' => '13XGK4J ' };

Any help would be appreciated. I did look at HTML::Miner and HTML::Tree but neither seemed to accomplish what I needed with my limited knowledge of HTML.
The longer serial number is a monitor and should be ignored, but I will handle that by not processing items with more than 7 digits in the serial number.
Regards,
Smaug.
Peddle faster monkeys!! I need more power!!

In reply to Retrieve select information from HTML by Smaug

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.