Xbox.ts shows instock all the time #2475
-
Hello I need a little help I'm trying to scrape the xbox store and it constantly shows instock does anyone have a xbox.ts working script that would mind sharing with me or helping me with Jeff's that would be greatly appreciated thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Just checking back if anybody had any solution for this thanks in advance. |
Beta Was this translation helpful? Give feedback.
-
So it looks like the Xbox store changed their layout and the way it checks if it is in stock or not is using a selector for the Out of Stock button. But that selector doesn't work any more with the updated layout and so that's why it is showing as in stock; The Out of Stock isn't found and therefore it's assumed it's In Stock. To fix it, you can update
Make sure the comma is still there after that part. So the whole file should look like this: import {Store} from './store';
export const Xbox: Store = {
currency: '$',
labels: {
outOfStock: {
container:
'._-_-node_modules--xbox-web-partner-core-build-pages-BundleBuilder-Components-BundleBuilderHeader-__BundleBuilderHeader-module___checkoutButton',
text: ['out of stock'],
},
},
links: [
{
brand: 'microsoft',
model: 'xbox series x',
series: 'xboxsx',
url: 'https://www.xbox.com/en-us/configure/8WJ714N3RBTL',
},
],
name: 'xbox',
}; I notice that this isn't tracking the Xbox Series S, but perhaps that's because it's easily found? If you DO want it to track the S, the whole file should be this instead: import {Store} from './store';
export const Xbox: Store = {
currency: '$',
labels: {
outOfStock: {
container:
'._-_-node_modules--xbox-web-partner-core-build-pages-BundleBuilder-Components-BundleBuilderHeader-__BundleBuilderHeader-module___checkoutButton',
text: ['out of stock'],
},
},
links: [
{
brand: 'microsoft',
model: 'xbox series x',
series: 'xboxsx',
url: 'https://www.xbox.com/en-us/configure/8WJ714N3RBTL',
},
{
brand: 'microsoft',
model: 'xbox series s',
series: 'xboxss',
url: 'https://www.xbox.com/en-us/configure/942J774TP9JN',
},
],
name: 'xbox',
}; Although, because the S is in stock, you'll always get alerts about it as well. Anyway, hope that all helps you out! |
Beta Was this translation helpful? Give feedback.
So it looks like the Xbox store changed their layout and the way it checks if it is in stock or not is using a selector for the Out of Stock button. But that selector doesn't work any more with the updated layout and so that's why it is showing as in stock; The Out of Stock isn't found and therefore it's assumed it's In Stock.
To fix it, you can update
src/store/model/xbox.ts
and change the text in quotes in thecontainer
section to the following:'._-_-node_modules--xbox-web-partner-core-build-pages-BundleBuilder-Components-BundleBuilderHeader-__BundleBuilderHeader-module___checkoutButton'
Make sure the comma is still there after that part. So the whole file should look like this: