pricecharts

track prices of consumer electronics
Log | Files | Refs | README

commit c5f6d4e5a44c3b8a5f67a674e0c3475dbcff9b9f
parent e92f5609ff4a53045f8fe754009c0f4c048f1101
Author: Kyle Milz <kyle@getaddrinfo.net>
Date:   Mon,  3 Nov 2014 21:29:09 -0700

product_scraper: bring brand into consistent style

Diffstat:
Mproduct_scraper.pl | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/product_scraper.pl b/product_scraper.pl @@ -105,14 +105,13 @@ for (keys %product_map) { my $description = get_tag_text($thumbnail_dom, ".ProductTitle"); next unless (defined $description); - # brand is easier to parse from general results page, sometimes - # shows up as text + # brand sometimes shows up as text my $brand = $thumbnail_dom->find(".ProductBrand")->text(); if ($brand eq "") { $brand = $thumbnail_dom->find(".ProductBrand")->html(); ($brand) = ($brand =~ m/Brand: ([A-Za-z]+)/); } - next if (not_defined($brand, "brand", $thumbnail_html)); + next if (not_defined($brand, ".ProductBrand", $thumbnail_html)); $product_sth->execute($part_num); if ($product_sth->fetchrow_arrayref()) {