Dive into web scraping and build a Next.js 13 eCommerce price tracker within a single video that teaches you data scraping, cron jobs, sending emails, deployment, and more.
The existing outOfStock variable will always return false even if the product is out of stock. Reason being, when any product page has "Currently unavailable." text, it is within two nested spans within the #availablity div.
To fix the problem, I'm using this code block and changed the named of the variable from outOfStock to isOutOfStock as it returns a Boolean.
The existing
outOfStock
variable will always return false even if the product is out of stock. Reason being, when any product page has "Currently unavailable." text, it is within two nested spans within the#availablity
div.To fix the problem, I'm using this code block and changed the named of the variable from
outOfStock
toisOutOfStock
as it returns a Boolean.