From da40bd143c1b66343ad9f0f60aa0e498e5d52310 Mon Sep 17 00:00:00 2001 From: DakkJaniels <6080734+DakkJaniels@users.noreply.github.com> Date: Wed, 14 Apr 2021 20:50:10 -0400 Subject: [PATCH 1/3] fix price off-by-one bug on pinned offer fix price/offer array mismatch. fix offers exceed price range message, should only appear after going through all items. --- config/fairgame.conf | 2 +- stores/amazon.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/fairgame.conf b/config/fairgame.conf index 0f4c0434..271936aa 100644 --- a/config/fairgame.conf +++ b/config/fairgame.conf @@ -231,7 +231,7 @@ "//*[@id='sc-buy-box-ptc-button']" ], "ATC": [ - "//div[@id='aod-pinned-offer' or @id='aod-offer' or @id='olpOfferList']//input[@name='submit.addToCart']" + "//div[@id='aod-pinned-offer' or @id='aod-offer']//input[@name='submit.addToCart']" ], "ATC_BUY_BOX":[ "//div[@id='qualifiedBuybox']//input[@id='add-to-cart-button']" diff --git a/stores/amazon.py b/stores/amazon.py index 002580d2..8b1eceac 100644 --- a/stores/amazon.py +++ b/stores/amazon.py @@ -676,7 +676,7 @@ def check_stock(self, asin, reserve_min, reserve_max, retry=0): ) else: prices = self.driver.find_elements_by_xpath( - "//div[@id='aod-pinned-offer' or @id='aod-offer']//div[contains(@id, 'aod-price')]//span[@class='a-price']//span[@class='a-offscreen']" + "//div[@id='aod-pinned-offer' or @id='aod-offer']//span[@class='a-price']//span[@class='a-offscreen']" ) if prices: break @@ -844,7 +844,7 @@ def check_stock(self, asin, reserve_min, reserve_max, retry=0): log.error(f" Price: {price_float} + {ship_float} shipping") log.error(f" Max: {reserve_max}") - log.info(f"Offers exceed price range ({reserve_min:.2f}-{reserve_max:.2f})") + log.info(f"Offers exceed price range ({reserve_min:.2f}-{reserve_max:.2f})") return in_stock def attempt_atc(self, offering_id, max_atc_retries=DEFAULT_MAX_ATC_TRIES): From d4f0a11c7f512a07f7186bfa3e34c6d4728a92f2 Mon Sep 17 00:00:00 2001 From: DakkJaniels <6080734+DakkJaniels@users.noreply.github.com> Date: Wed, 14 Apr 2021 20:51:26 -0400 Subject: [PATCH 2/3] Update version.py update version number --- utils/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/version.py b/utils/version.py index f49278b7..b26d1f85 100644 --- a/utils/version.py +++ b/utils/version.py @@ -27,7 +27,7 @@ # See https://www.python.org/dev/peps/pep-0440/ for specification # See https://www.python.org/dev/peps/pep-0440/#examples-of-compliant-version-schemes for examples -__VERSION = "0.6.4" +__VERSION = "0.6.5" version = Version(__VERSION) From 21801703d9d51a7378e80da2a2fc29fc09d754b8 Mon Sep 17 00:00:00 2001 From: DakkJaniels <6080734+DakkJaniels@users.noreply.github.com> Date: Wed, 14 Apr 2021 21:04:59 -0400 Subject: [PATCH 3/3] Update Pipfile update chromedriver version --- Pipfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pipfile b/Pipfile index 11418b9b..319813bd 100644 --- a/Pipfile +++ b/Pipfile @@ -10,7 +10,7 @@ pyinstaller = "*" requests = "==2.24.0" click = "*" selenium = "*" -chromedriver-py = "==88.0.4324.96" +chromedriver-py = "~=90.0" furl = "*" twilio = "*" discord-webhook = "*"