#!/usr/bin/env perl use strict; use warnings; use HTML::HTML5::Parser; use XML::LibXML::QuerySelector; my $input = shift or die("Usage: $0 filename\n"); my $html = HTML::HTML5::Parser->load_html(location => $input); print $html->querySelector('h2.product-name a')->textContent, "\n"; print $html->querySelector('div.price-box span.price')->textContent, "\n";