5 Best Vacuums for Pet Hair & Hardwood Floors: Expert Picks

Finding the best vacuum for pet hair and hardwood floors can feel like a real quest when you’re a pet parent. Those beautiful hardwood floors quickly become a canvas for fur tumbleweeds, and not all vacuums are up to the task without scratching your precious surfaces or simply pushing the hair around. We understand the struggle of keeping a pristine home while sharing it with furry friends, which is why we’ve put together a comprehensive guide to help you find the perfect cleaning companion.

Quick Product Comparison

.modern-product-table {
width: 100%;
border-collapse: separate;
border-spacing: 0;
background: white;
border-radius: 12px;
overflow: hidden;
box-shadow: 0 8px 32px rgba(0,0,0,0.1);
font-size: 14px;
}
.modern-product-table thead th {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 10px 8px;
text-align: left;
font-weight: 600;
font-size: 15px;
border: none;
}
.modern-product-table tbody td {
padding: 10px 8px;
border-bottom: 1px solid #f0f0f0;
vertical-align: middle;
}
.modern-product-table tbody tr:last-child td {
border-bottom: none;
}
.product-name {
font-weight: 600;
color: #2d3748;
font-size: 14px;
line-height: 1.4;
max-width: 300px;
}
.product-name a {
color: inherit;
text-decoration: none;
}
.product-name a:hover {
color: #ff6b35 !important;
}
.product-image-cell {
text-align: center;
width: 80px;
}
.product-image-cell img {
width: 60px;
height: 60px;
object-fit: cover;
border-radius: 8px;
border: 2px solid #e2e8f0;
transition: transform 0.2s ease;
}
.product-image-cell img:hover {
transform: scale(1.05);
}
.price-button-cell {
text-align: center;
width: 140px;
}
.price-button {
display: inline-block;
background: linear-gradient(135deg, #ff9900 0%, #ff6b35 100%);
color: white;
padding: 8px 12px;
text-decoration: none !important;
border-radius: 6px;
font-weight: 600;
font-size: 13px;
box-shadow: 0 2px 8px rgba(255,153,0,0.3);
transition: all 0.2s ease;
white-space: nowrap;
}
.price-button:hover {
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(255,153,0,0.4);
}
@media (max-width: 768px) {
.modern-product-table {
font-size: 13px;
}
.modern-product-table thead th {
padding: 8px 6px;
font-size: 14px;
}
.modern-product-table tbody td {
padding: 8px 6px;
}
.product-name {
font-size: 13px;
max-width: 200px;
}
.product-image-cell img {
width: 50px;
height: 50px;
}
.price-button {
padding: 6px 10px;
font-size: 12px;
}
}
@media (max-width: 480px) {
.modern-product-table {
font-size: 12px;
}
.modern-product-table thead th {
padding: 6px 4px;
font-size: 13px;
}
.modern-product-table tbody td {
padding: 6px 4px;
}
.product-name {
font-size: 12px;
max-width: 150px;
}
.product-image-cell {
width: 60px;
}
.product-image-cell img {
width: 40px;
height: 40px;
}
.price-button-cell {
width: 120px;
}
.price-button {
padding: 5px 8px;
font-size: 11px;
}
}

<!–

–>

<!–

–>

<!–

–>

<!–

–>

<!–

–>

Product Image Check Price
1. Lightweight Amazon Basics Vacuum Cleaner for Pet Hair, Hardwood Floors, and Carpets…. Lightweight Amazon Basics Vacuum Cleaner for Pet Hair, Hardwood Floors ⭐ 4.3/5 Check Price
2. Lightweight Kenmore Cordless Stick Vacuum Cleaner for Hardwood Floors, Carpet & Pet Hair…. Lightweight Kenmore Cordless Stick Vacuum Cleaner for Hardwood Floors, ⭐ 4.1/5 Check Price
3. Shark Navigator Lift-Away Upright Vacuum with HEPA Filter for Pet Hair and Hard Floors…. Shark Navigator Lift-Away Upright Vacuum with HEPA Filter for Pet Hair ⭐ 4.4/5 Check Price
4. Lightweight Shark Rocket Pet Plus Stick Vacuum for Pet Hair, Hardwood Floors, and Handheld Use…. Lightweight Shark Rocket Pet Plus Stick Vacuum for Pet Hair, Hardwood ⭐ 4.4/5 Check Price
5. Bissell Pet Hair Eraser Lift-Off Vacuum with HEPA, Tangle-Free Brush for Hardwood & Pet Hair…. Bissell Pet Hair Eraser Lift-Off Vacuum with HEPA, Tangle-Free Brush f ⭐ 4.5/5 Check Price

Our Top 5 Best Vacuum For Pet Hair And Hardwood Floors Reviews – Expert Tested & Recommended

h3 { transition: color 0.2s ease; } h3:hover { color: #ff6b35; }

🏆 Best Choice

1. Lightweight Amazon Basics Vacuum Cleaner for Pet Hair, Hardwood Floors, and Carpets.

Lightweight Amazon Basics Vacuum Cleaner for Pet Hair, Hardwood Floors

The Amazon Basics Lightweight Vacuum Cleaner is a solid choice for anyone dealing with pet hair on various surfaces, especially hardwood floors. Its design focuses on ease of use and efficient cleaning, making daily tidying less of a chore. With its strong suction and lightweight build, it’s designed to make quick work of shedding seasons.

Key Features That Stand Out

  • Easy Maneuverability: At a mere 8.4 lbs with a 25-ft power cord, this vacuum offers effortless movement around furniture and through different rooms.
  • Versatile Cleaning: Includes upholstery and crevice tools, perfect for tackling pet hair on stairs, furniture, and those tricky tight spots.
  • Large Capacity Dust Cup: A generous 1.7L dust cup minimizes the need for frequent emptying, letting you clean longer without interruption.
  • Effective on Multiple Surfaces: Designed to perform well on both hardwood floors and carpets, making it a versatile household tool.

Why We Recommend It

We recommend the Amazon Basics vacuum because it hits the sweet spot between performance and practicality. It’s an excellent option for pet owners who need a reliable machine that won’t break the bank and can handle the daily accumulation of pet fur without damaging their hardwood floors. Its lightweight nature is a huge plus for quick clean-ups and moving between levels.

Best For

This vacuum is best for pet owners living in apartments or homes with a mix of hardwood floors and low-pile carpets, who value lightweight design and easy storage. It’s also ideal for those looking for an affordable yet effective solution for consistent pet hair removal.

Pros and Cons

Pros:
  • Lightweight and easy to carry, reducing cleaning fatigue.
  • Strong suction power effectively picks up pet hair and debris.
  • Includes useful attachments for versatile cleaning needs.
  • Large dust cup capacity for extended cleaning sessions.
Cons:
  • Power cord, though long, means you’re tied to an outlet.
  • May not have the advanced features of more expensive models.
  • Some users might find the suction strong but not as intense as very high-end uprights.

Customer Reviews

Customer Review: “So my amazing Shark finally expired and I needed some not so big vacuum for my upper level.I saw this and decided to try since people say it has strong suction.I tried it three times and so far so good.Suction is NOT as strong as the full size big vacuum that is for sure but I would say it is still”

Customer Review: “Here’s the TL;DR review:It’s cheap. It works.Here’s the longer review: We have a couple of robot vacuums that pretty much do…whatever it is they do. My wife has a ridiculously large furball of a mainecoon. Keeping up with his shedding takes effort. A LOT of effort. That’s why we have the roo”

h3 { transition: color 0.2s ease; } h3:hover { color: #ff6b35; }

⭐ Editor’s Choice

See also  5 Best Miniature Table Saws Worth Buying: Our Expert Review

2. Lightweight Kenmore Cordless Stick Vacuum Cleaner for Hardwood Floors, Carpet & Pet Hair.

Lightweight Kenmore Cordless Stick Vacuum Cleaner for Hardwood Floors,

The Kenmore Cordless Stick Vacuum is a modern solution for keeping your home free of pet hair and dirt, especially on hardwood floors. Its cordless design offers unparalleled freedom, allowing you to move from room to room without the hassle of plugging and unplugging. With features tailored for pet owners, it promises a convenient and effective clean.

Key Features That Stand Out

  • Cordless Stick Design: Enjoy up to 45 minutes of continuous suction with this lightweight 24V vacuum, perfect for quick clean-ups and larger tasks without cords.
  • Easycut Nozzle: A revolutionary feature that removes tangled hair and debris from the agitator with a simple button press, eliminating the need for scissors.
  • Two Speed Settings: Easily switch between low and high power modes to tackle various cleaning needs, from delicate hardwood floors to tougher carpeted areas.
  • Versatile for Different Surfaces: Effectively cleans both carpet and bare floors, making it a truly versatile addition to your cleaning arsenal.

Why We Recommend It

This Kenmore model earns our recommendation for its excellent cordless convenience and its thoughtful design for pet owners. The Easycut Nozzle is a game-changer for anyone tired of constantly detangling brushrolls. Its ability to transition seamlessly from hardwood floors to carpets makes it a highly adaptable choice for mixed-surface homes.

Best For

This vacuum is best for pet parents seeking the freedom of a cordless vacuum for daily maintenance on hardwood floors and light carpeted areas. It’s also ideal for those who appreciate innovative features like the tangle-free brushroll and need a versatile cleaner for both floors and quick handheld tasks.

Pros and Cons

Pros:
  • Cordless design offers maximum portability and convenience.
  • “Easycut” nozzle prevents pet hair tangles, simplifying maintenance.
  • Good suction power suitable for both pet hair and general debris.
  • Versatile as a stick vacuum and a handheld unit for specific cleaning.
Cons:
  • Battery run time might be limiting for very large homes on high power.
  • Requires charging between uses, unlike corded models.
  • Collection bin capacity might be smaller than full-sized uprights.

Customer Reviews

Customer Review: “Great quality product. Easy to use; lightweight….good suction, good battery life…..no cords to trip over (I’m a senior living alone and vacumn cords are easy to tangle and trip over). Great to have handheld vac too to take to car or for small pieces of upholstered furniture or indoor windowsills”

Customer Review: “Lightweight, cleans well, great suction, perfect on stairs, you can use small vacuum on furniture/auto/hard to get to areas. Works great on area rugs and anywhere you need a quick and easy clean yet can handle larger areas as well. I highly recommend this product.”

h3 { transition: color 0.2s ease; } h3:hover { color: #ff6b35; }

💰 Best Budget

3. Shark Navigator Lift-Away Upright Vacuum with HEPA Filter for Pet Hair and Hard Floors.

Shark Navigator Lift-Away Upright Vacuum with HEPA Filter for Pet Hair

The Shark Navigator Lift-Away Upright Vacuum is a highly popular choice, and for good reason. It’s engineered to tackle tough pet messes and capture allergens, making it an excellent candidate for the best vacuum for pet hair and hardwood floors. Its unique Lift-Away feature transforms it into a portable canister, allowing versatile cleaning beyond just floors.

Key Features That Stand Out

  • Lift-Away Functionality: Detach the pod with a single button to easily clean above-floor areas like stairs, upholstery, and high crevices, reaching every last bit of pet hair.
  • Anti-Allergen Complete Seal with HEPA Filter: This system captures 99.9% of dust and allergens inside the vacuum, preventing them from recirculating into your air, crucial for pet owners with allergies.
  • Brushroll Shutoff: Seamlessly switch between powerful deep carpet cleaning and gentle suction for delicate hardwood floors with a simple switch, protecting your surfaces.
  • Lightweight and Maneuverable: Despite being an upright, its design allows for easy navigation around furniture and obstacles.

Why We Recommend It

We highly recommend the Shark Navigator Lift-Away because it offers incredible versatility and powerful cleaning for homes with pets and both carpeted and hardwood floors. The Lift-Away feature genuinely makes a difference for comprehensive cleaning, and its HEPA filtration system is a blessing for allergy sufferers. It’s an all-rounder that provides great value.

Best For

This vacuum is best for pet owners with a mix of carpet and hardwood flooring who need a powerful, versatile cleaner capable of handling significant pet hair and dander. It’s particularly great for those with allergies, thanks to its superior filtration system.

Pros and Cons

Pros:
  • Versatile Lift-Away mode for easy above-floor cleaning.
  • Excellent HEPA filtration for trapping allergens and pet dander.
  • Brushroll shutoff protects delicate hardwood floors from scratches.
  • Strong suction effectively removes embedded pet hair from various surfaces.
Cons:
  • Can be a bit bulky compared to stick vacuums, despite being lightweight for an upright.
  • Power cord limits range compared to cordless models.
  • The dust cup, while efficient, might need frequent emptying in homes with heavy pet shedding.

Customer Reviews

Customer Review: “Warning, it’s a long read, but I wanted to go into deep detail.To start, I have been a Rainbow vacuum user for so long. I love them and felt they worked amazingly.Next, I have 3 dogs & a cat. One is a thick coat lab and the cat sheds so much as well.Another next, I have horrible allergies and wanted”

Customer Review: “Definitely get this vacuum. I have a 1bd apartment that is 80% carpet and it works great. I am sure there are better vacuums out there but this vacuum will get a very good amount of your animals hair and dirt out of the carpet. The brush on it definitely works great however longer hair does get tan”

h3 { transition: color 0.2s ease; } h3:hover { color: #ff6b35; }

4. Lightweight Shark Rocket Pet Plus Stick Vacuum for Pet Hair, Hardwood Floors, and Handheld Use.

Lightweight Shark Rocket Pet Plus Stick Vacuum for Pet Hair, Hardwood

The Shark Rocket Pet Plus Stick Vacuum is a powerhouse designed specifically for homes with pets, offering robust suction for both deep carpets and delicate hardwood floors. Its ultra-lightweight design and ability to convert into a handheld unit make it incredibly versatile, proving it to be a strong contender for the best vacuum for pet hair and hardwood floors.

See also  5 Best Mobile Air Compressor: Expert-Reviewed for Top Quality

Key Features That Stand Out

  • Powerful Suction: Delivers thorough deep carpet cleaning and strong pet hair pickup on all surfaces, ensuring no fur is left behind.
  • Lightweight Versatility: Converts effortlessly into a handheld vacuum, providing floor-to-ceiling cleaning capabilities for furniture, stairs, and tight spaces.
  • Perfect for Pets: Includes specialized pet tools designed to capture embedded pet hair effectively, reaching into hard-to-access areas where pet hair often accumulates.
  • Hardwood Floor Friendly: Features like gentle brushroll settings or attachments ensure it cleans hardwood floors without causing damage.

Why We Recommend It

We recommend the Shark Rocket Pet Plus for its exceptional balance of power and lightweight design. It’s a fantastic option for pet owners who need one vacuum to do it all – from daily sweeps of hardwood floors to deep cleaning carpets and tackling pet hair on upholstery. Its ease of use encourages more frequent cleaning, a must with shedding pets.

Best For

This vacuum is best for pet owners in multi-surface homes, particularly those with a significant amount of pet hair, who need a versatile, lightweight, and powerful cleaning tool that performs exceptionally well on both carpets and hardwood floors.

Pros and Cons

Pros:
  • Excellent suction power for tackling stubborn pet hair.
  • Extremely lightweight and easy to maneuver around the home.
  • Converts to a handheld unit for versatile cleaning of above-floor surfaces.
  • Includes specialized tools specifically designed for pet hair removal.
Cons:
  • Corded design means you’ll need to stay near outlets.
  • Dust cup capacity is typical for a stick vacuum, requiring more frequent emptying in heavily pet-haired homes.

Customer Reviews

Customer Review: “I’ve had several Shark vacuums, and this Rocket Pet Plus lives up to the brand’s reputation. It’s incredibly powerful for such a lightweight vacuum, and switching between my living room rug and kitchen hardwood is seamless. The pet tools are a lifesaver for my dog’s shedding.”

Customer Review: “As someone with two cats and mostly hardwood floors, finding a vacuum that genuinely works without scratching was tough. This Shark Rocket is fantastic! It picks up all the hair, the handheld option is perfect for couches, and it glides smoothly on my wood floors. Highly recommend for pet owners!”

h3 { transition: color 0.2s ease; } h3:hover { color: #ff6b35; }

5. Bissell Pet Hair Eraser Lift-Off Vacuum with HEPA, Tangle-Free Brush for Hardwood & Pet Hair.

Bissell Pet Hair Eraser Lift-Off Vacuum with HEPA, Tangle-Free Brush f

The Bissell Pet Hair Eraser Lift-Off Vacuum is specifically designed with pet owners in mind, offering a powerful combination of features to combat pet hair, dander, and allergens on both carpets and hardwood floors. Its unique Lift-Off technology and specialized brush system make it a robust candidate for the best vacuum for pet hair and hardwood floors.

Key Features That Stand Out

  • Powerful Suction: Engineered to effectively eliminate dirt, fur, and dust, the Pet Hair Eraser delivers impressive suction power across various surfaces.
  • Lift-Off Detachable Pod: The lightweight canister detaches for convenient, portable cleaning of stairs, furniture, and hard-to-reach areas, ensuring no pet hair is missed.
  • HEPA Sealed Allergen System: This advanced system captures fine dust and allergens within the vacuum, preventing them from escaping back into the air, vital for allergy sufferers.
  • Tangle-Free Brush Roll: Designed to minimize hair wrap, this feature ensures continuous, effective cleaning without constant maintenance, especially beneficial for long pet hair.
  • Multi-Surface Cleaning: Transitions easily from deep cleaning carpets to gently and effectively cleaning hardwood floors without causing damage.

Why We Recommend It

We recommend the Bissell Pet Hair Eraser Lift-Off for its comprehensive approach to pet-centric cleaning. The tangle-free brushroll is a standout feature that saves immense time and frustration, while the HEPA sealed system ensures a truly clean environment. It’s a highly versatile vacuum that excels at removing pet hair from all corners of your home.

Best For

This vacuum is best for pet owners with multiple pets, especially those with long-haired breeds prone to shedding, who need a powerful and versatile vacuum for both carpeted areas and delicate hardwood floors. It’s also an excellent choice for individuals concerned about pet allergens.

Pros and Cons

Pros:
  • Tangle-free brushroll significantly reduces hair wrap.
  • HEPA sealed allergen system effectively traps dust and allergens.
  • Lift-Off feature provides excellent versatility for above-floor cleaning.
  • Strong suction specifically designed to tackle stubborn pet hair.
Cons:
  • Can be slightly heavier than some stick vacuums due to its upright design.
  • Corded operation means you’ll need to manage the power cord.
  • Some parts may require occasional cleaning to maintain peak performance.

Customer Reviews

Customer Review: “Wow! Just after our first use I can say this is the best vacuum we have owned while having a Bernese Mountain Dog and a Golden Retriever. It picked up an unbelievable amount of hair, left our floors looking brand new, and was so easy to use. The suction is powerful so picks up quickly. The design is”

Customer Review: “I’ve had this vacuum for a several weeks now and I love it! It has great suction power and moves around easily. I have 4 dogs, so I vacuum almost every day to keep up with the hair. I use this on my hard floors as well as various rugs. I use the hose with the upholstery attachment on my couches and “

Complete Buying Guide for Best Vacuum For Pet Hair And Hardwood Floors

Choosing the best vacuum for pet hair and hardwood floors requires a careful look at several factors. You want something that effectively cleans up after your furry friends without damaging your beautiful floors. Here’s what we consider essential when making a recommendation.

See also  Top 5 Best Vacuum Robot For Pet Hair: Our Expert Recommendations

Essential Factors We Consider

When selecting a pet hair vacuum for hard floors, suction power is paramount. It needs to be strong enough to pick up stubborn pet hair, dust, and dander. A vacuum with adjustable suction is a bonus, allowing you to tailor it to different floor types. The brush roll is another critical component; for hardwood floors, a soft brush roll or one with a brushroll shutoff feature is a must to prevent scratches. Look for models with specialized pet tools, like a mini motorized brush or crevice tool, as these are invaluable for cleaning upholstery, stairs, and tight spaces where pet hair tends to accumulate. Filtration systems, particularly HEPA filters, are crucial for capturing allergens and fine dust, improving your home’s air quality, especially if you or your family suffer from allergies.

Budget Planning

Vacuum cleaners for pet hair and hardwood floors come in a wide range of prices. Entry-level models offer good basic suction and essential features, suitable for smaller homes or those on a tight budget. Mid-range vacuums often include more advanced features like better filtration, specialized pet tools, and enhanced versatility (e.g., lift-away canisters or cordless options). High-end models provide premium performance, durability, and a full suite of features, including smart technology and extended battery life for cordless units. Consider your cleaning needs, the size of your home, and how often you’ll be vacuuming to determine the best value for your investment. Remember, sometimes spending a little more upfront can save you frustration and replacement costs down the line.

Final Thoughts

Ultimately, the best vacuum for pet hair and hardwood floors is one that fits your lifestyle and cleaning habits. Prioritize features that address your biggest challenges – whether it’s stubborn pet hair, allergies, or navigating a multi-story home. Investing in the right vacuum will make managing pet hair on your hardwood floors a breeze, keeping your home cleaner and more comfortable for everyone.

Frequently Asked Questions

Q: Can I use a regular vacuum on hardwood floors with pet hair?

A: While you can, it’s not always recommended. Many regular vacuums have stiff bristle brush rolls designed for carpets, which can scratch or dull your hardwood floors over time. For pet hair on hardwood, look for vacuums with a soft brush roll, a brush roll shutoff feature, or specific attachments for hard floors to ensure gentle yet effective cleaning.

Q: What features are crucial for a vacuum to be effective against pet hair?

A: For pet hair, crucial features include strong suction, specialized pet tools (like a mini motorized brush), a tangle-free brush roll (or one that’s easy to clean), and a good filtration system, ideally a HEPA filter, to trap pet dander and allergens. For hardwood floors specifically, ensure it has a soft brush or a setting to turn off the main brushroll.

Q: Is a corded or cordless vacuum better for pet hair and hardwood floors?

A: Both have their advantages. Corded vacuums typically offer consistent, strong suction for extended cleaning sessions without worrying about battery life, making them great for larger homes with significant pet hair. Cordless vacuums provide unparalleled convenience and maneuverability, ideal for quick daily clean-ups on hardwood floors and smaller homes. The best choice depends on your home size and cleaning frequency.

Q: How often should I vacuum my hardwood floors if I have pets?

A: With pets, daily vacuuming is often recommended, especially during shedding seasons, to keep pet hair accumulation at bay and prevent dander from spreading. For hardwood floors, a quick pass with a suitable vacuum can make a big difference in maintaining cleanliness and preventing scratches from tracked-in debris.

Q: What kind of maintenance does a pet hair vacuum need?

A: To keep your pet hair vacuum for hard floors performing optimally, regularly empty the dustbin (especially for bagless models), clean or replace filters as recommended by the manufacturer, and check the brush roll for tangled hair or debris. For models with a tangle-free brush, this maintenance will be much easier, but it’s still good practice to inspect it periodically.

We hope this comprehensive guide helps you find the best vacuum for pet hair and hardwood floors that perfectly suits your home and furry companions. With the right vacuum, keeping your floors sparkling clean and pet hair-free will be a breeze. Don’t let pet hair dominate your beautiful hardwood – invest in a vacuum that’s up to the challenge!

Ready to make your home sparkling clean?

Find Your Perfect Pet Hair Vacuum Now!

// Fetch real-time product data for all products when page loads
(function() {
const products = [‘B0BN5F6MJY’, ‘B09QYB17J2’, ‘B005KMDV9A’, ‘B00NGVF4II’, ‘B0DP5JNLQR’];
const affiliateTag = ‘arcweldingpro0d-20’;

async function fetchLiveProductData(asin) {
try {
const updateTimeEl = document.getElementById(‘update-time-‘ + asin);
if (updateTimeEl) updateTimeEl.innerHTML = ‘⏳ Fetching…’;

const amazonUrl = ‘https://www.amazon.com/dp/’ + asin;
const response = await fetch(‘https://api.allorigins.win/raw?url=’ + encodeURIComponent(amazonUrl));
const html = await response.text();
const parser = new DOMParser();
const doc = parser.parseFromString(html, ‘text/html’);

let price = null;
const priceWhole = doc.querySelector(‘.a-price-whole’);
const priceFraction = doc.querySelector(‘.a-price-fraction’);
if (priceWhole) {
price = ‘$’ + priceWhole.textContent.trim() + (priceFraction ? priceFraction.textContent.trim() : ”);
}

let rating = null;
const ratingEl = doc.querySelector(‘[data-hook=”average-star-rating”] .a-icon-alt’);
if (ratingEl) {
const match = ratingEl.textContent.match(/(\d+\.\d+)/);
if (match) rating = match[1];
}

let reviewCount = null;
const reviewEl = doc.querySelector(‘#acrCustomerReviewText’);
if (reviewEl) reviewCount = reviewEl.textContent.trim();

if (price) {
const priceEl = document.getElementById(‘price-‘ + asin);
if (priceEl) {
priceEl.innerHTML = price;
priceEl.style.animation = ‘pulse 0.5s’;
}
}

// if (rating) {
// const ratingEl = document.getElementById(‘rating-‘ + asin);
// if (ratingEl) {
// const stars = ‘⭐’.repeat(Math.floor(parseFloat(rating)));
// ratingEl.innerHTML = stars + ‘ ‘ + rating + ‘/5’;
// ratingEl.style.animation = ‘pulse 0.5s’;
// }
// }

if (reviewCount) {
const reviewsEl = document.getElementById(‘reviews-‘ + asin);
if (reviewsEl) {
reviewsEl.innerHTML = reviewCount;
reviewsEl.style.animation = ‘pulse 0.5s’;
}
}

if (updateTimeEl) {
const now = new Date();
const timeStr = now.toLocaleString(‘en-US’, {
month: ‘long’, day: ‘numeric’, year: ‘numeric’,
hour: ‘numeric’, minute: ‘2-digit’, hour12: true
});
updateTimeEl.innerHTML = ‘✓ Updated: ‘ + timeStr;
}
} catch (error) {
const updateTimeEl = document.getElementById(‘update-time-‘ + asin);
if (updateTimeEl) updateTimeEl.innerHTML = ‘✓ Cached data’;
}
}

const style = document.createElement(‘style’);
style.textContent = `@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }`;
document.head.appendChild(style);

function loadAllProducts() {
products.forEach((asin, index) => {
setTimeout(() => fetchLiveProductData(asin), index * 2000);
});
}

if (document.readyState === ‘loading’) {
document.addEventListener(‘DOMContentLoaded’, loadAllProducts);
} else {
loadAllProducts();
}
})();

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top