in reply to Re: Parse HTML Code for hidden values
in thread Parse HTML Code for hidden values
Here is a snipet of my test code:Dumper($response->{body}->{table})
And the result is:print "body-table is:", Dumper($response->{body}->{table}), "\n"; print "=============================================================== +===\n"; my %rec; for (@{ $response->{body}{table} }) { print "Data Record Found - Body Table \n"; my ($key) = grep $_ ne 'content', keys(%{$_->{tr}{td}}); my $val = $_->{tr}{td}{$key}; $rec{$key} = $val; } print "rec is:", Dumper($rec), "\n";
Any help is GREATLY appreciated!! Thanks!body-table is:$VAR1 = [ { 'tr' => { 'td' => { 'ReturnStatus' => 'Completed', 'content' => "Return Status:\x{a0}" } } }, { 'tr' => [ { 'td' => { 'StateInfo' => '12345', 'content' => "StateInfo:\x{a0}" } }, { 'td' => { 'MultipleSubAccount' => 'N', 'content' => "Multiple Sub Account:\x{a0 +}" } }, { 'td' => { 'Count' => '1', 'content' => "Count:\x{a0}" } }, { 'td' => { 'content' => "Default Account:\x{a0}", 'DefaultAccount' => '1234567' } }, { 'td' => { 'content' => "Caller Phone Number:\x{a0} +", 'CallerPhoneNumber' => '214-555-1212' } }, { 'td' => { 'CallerHouseNumber' => ' 123', 'content' => "Caller House Number:\x{a0} +" } }, { 'td' => { 'ApartmentNum' => {}, 'content' => "Apartment Num:\x{a0}" } }, { 'td' => { 'CallerSalutation' => {}, 'content' => "Caller Salutation:\x{a0}" } }, { 'td' => { 'CallerFirstName' => 'JOHN', 'content' => "Caller First Name:\x{a0}" } }, { 'td' => { 'content' => "Caller Last Name:\x{a0}", 'CallerLastName' => 'SMITH' } }, { 'td' => { 'content' => "Salutation:\x{a0}", 'Salutation' => {} } }, { 'td' => { 'FirstName' => 'JOHN', 'content' => "FirstName:\x{a0}" } }, { 'td' => { 'content' => "MiddleInitial:\x{a0}", 'MiddleInitial' => {} } }, { 'td' => { 'LastName' => 'SMITH', 'content' => "LastName:\x{a0}" } }, { 'td' => { 'Honorific' => {}, 'content' => "Honorific:\x{a0}" } }, { 'td' => { 'content' => "FullName:\x{a0}", 'FullName' => 'JOHN SMITH' } }, { 'td' => { 'OtherName' => {}, 'content' => "OtherName:\x{a0}" } }, { 'td' => { 'OtherNameUsage' => {}, 'content' => "OtherNameUsage:\x{a0}" } }, { 'td' => { 'HouseNumber' => '123', 'content' => "House Number:\x{a0}" } }, { 'td' => { 'content' => "UnitNumber:\x{a0}", 'UnitNumber' => {} } }, { 'td' => { 'content' => "City:\x{a0}", 'City' => 'ANYTOWN' } }, { 'td' => { 'content' => "State:\x{a0}", 'State' => 'OH' } }, { 'td' => { 'Zip' => '12345-1234', 'content' => "Zip:\x{a0}" } }, { 'td' => { 'AddressLine1' => 'JOHN SMITH', 'content' => "AddressLine1:\x{a0}" } }, { 'td' => { 'AddressLine2' => '123 W MAIN ST', 'content' => "AddressLine2:\x{a0}" } }, { 'td' => { 'AddressLine3' => 'ANYTOWN OH 12345-123 +4', 'content' => "AddressLine3:\x{a0}" } }, { 'td' => { 'AddressLine4' => {}, 'content' => "AddressLine4:\x{a0}" } }, { 'td' => { 'AddressLine5' => {}, 'content' => "AddressLine5:\x{a0}" } }, { 'td' => { 'content' => "AddressLine6:\x{a0}", 'AddressLine6' => {} } }, { 'td' => { 'AddressLine7' => {}, 'content' => "AddressLine7:\x{a0}" } }, { 'td' => { 'content' => "AddressLine8:\x{a0}", 'AddressLine8' => {} } }, { 'td' => { 'a' => { 'href' => 'lastpmt.html?stateInfo +=12345', 'content' => 'Last Payment Info' } } }, { 'td' => { 'a' => { 'href' => 'serverrform1.html?stat +eInfo=12345', 'content' => 'Service Error' } } }, { 'td' => { 'a' => { 'href' => 'stopinfoform.html?stat +eInfo=12345', 'content' => 'Stop/Start' } } }, { 'td' => { 'a' => { 'href' => 'renewinfoform.html?sta +teInfo=12345', 'content' => 'Make a Payment' } } }, { 'td' => { 'a' => { 'href' => 'loginform.html', 'content' => 'Change Login' } } } ] } ]; ================================================================== Data Record Found - Body Table Data Record Found - Body Table rec is:$VAR1 = undef;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Parse HTML Code for hidden values
by choroba (Cardinal) on Aug 30, 2010 at 14:19 UTC | |
by ikegami (Patriarch) on Sep 05, 2010 at 04:21 UTC |