jef / streetmerchant

🤖 The world's easiest, most powerful stock checker
https://jef.buzz/streetmerchant
MIT License
4.96k stars 1.3k forks source link

Efficiency - storefront, not individual card #590

Closed Tiffys closed 3 years ago

Tiffys commented 3 years ago

Description

It seems to me that the way the bot works at the moment is opening a new chromium window with no cache to check each and every card. This wastes a ton of bandwidth, and time.

Possible solution

Search storefronts for every card you want to check instead. Instead of a dozen individual card's pages getting checked you can just check one storefront. For instance, the big three in the US:

https://www.bestbuy.com/site/computer-cards-components/video-graphics-cards/abcat0507002.c?id=abcat0507002&qp=brand_facet%3DBrand~ASUS%5Ebrand_facet%3DBrand~EVGA%5Ebrand_facet%3DBrand~NVIDIA%5Egpusv_facet%3DGraphics%20Processing%20Unit%20(GPU)~NVIDIA%20GeForce%20RTX%203080&intl=nosplash

https://www.amazon.com/stores/GeForce/RTX3080_GEFORCERTX30SERIES/page/6B204EA4-AAAC-4776-82B1-D7C3BD9DDC82

https://www.newegg.com/p/pl?d=rtx+3080&N=601357282%20100007709

Tiffys commented 3 years ago

Its not that simple otherwise it would have been done already. Each add to cart button has the same class name. A complete overhaul would be needed. Have any ideas how to deal with buttons of the same class?

Newegg for instance, check this sorta stuff:

<div class="item-stock" id="stock_14-487-518"></div> <div class="item-stock" id="stock_14-137-598"></div>

Then move up the tree & check... <div class="item-button-area">

Or you could just check the larger element & compare against changes, sorta like what distill.io does.

rotemgrim commented 3 years ago

Its not that simple otherwise it would have been done already. Each add to cart button has the same class name. A complete overhaul would be needed. Have any ideas how to deal with buttons of the same class?

no need to deal with buttons - when an item on storefront is seen as "in stock" just navigate to the item's page and use previous add to cart method.

jef commented 3 years ago

Not a bad idea. I think we originally did this with nvidia, but quickly changed to a different format because the "overall view" did not show in stock, whereas the individual did. I can't be certain that this won't be the same for other sites, but realistically should not be the case.

I'd be interested in testing this in the future as this is good idea.

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

jef commented 3 years ago

Superseded by: https://github.com/jef/streetmerchant/issues/1208