NeweggBot icon indicating copy to clipboard operation
NeweggBot copied to clipboard

Newegg Canada Item added to cart but still says "Card not in Stock"

Open MrHarBear opened this issue 5 years ago • 1 comments

First of all really appreciate you building this tool!

I am trying to use this on Newegg Canada to get an RX 6000s card this Wednesday. I followed the instruction and downloaded the Canada branch. I used a dummy item and the script runs fine adding the item into cart but it will not check out. Please see the screenshot for reference.

image

MrHarBear avatar Nov 16 '20 20:11 MrHarBear

This could be due to a change by Newegg in the HTML element for the cart total. Check this issue thread for a possible solution.

TL;DR: Try changing the first part of the check_cart method from:

try {
  ...
  var element = await page.$('span.amount')
  var text = await page.evaluate(element => element.textContent, element);
 ...
 }
...

to:

const amountElementName = ".summary-content-total"
 try {
   await page.waitForSelector(amountElementName, { timeout: 1000 })
   var amountElement = await page.$(amountElementName)
   var text = await page.evaluate(element => element.textContent, amountElement)
    ....
    }
   ....

Codolophier avatar Nov 30 '20 00:11 Codolophier