Hari-Nagarajan / fairgame

Tool to help us buy hard to find items.
GNU General Public License v3.0
2.44k stars 803 forks source link

Support Amazon.pl #540

Closed Grelo4ka closed 3 years ago

Grelo4ka commented 3 years ago

Describe the bug Today Amazon launched amazon.pl; yet, fairgame crashes when trying to find the login page

To Reproduce Steps to reproduce the behavior:

  1. Edit 'config/amazon_config.json', replacing the "amazon_website" link by "amazon.pl"
  2. Launch fairgame (python3.8 app.py amazon --test)
  3. See error

Expected behavior Logging in and checking the availability of given products

Screenshots fairgame

Desktop (please complete the following information):

DakkJaniels commented 3 years ago

The bot must not have all the amazon.pl page titles in the fairgame.conf file. If you provide them, they can be filled in.

unapproachable commented 3 years ago

I don't see the error message in your post. As mentioned, it's probably related to missing localized terms.

If someone attaches and updated version of /config/fairgame.conf with additional localization information, we can get it rolled back in to the codebase. This applies for amazon.pl or any other locales that we don't have the correct terms for.

devNostyle commented 3 years ago
{
  "FAIRGAME": {
    "profile_name": ".profile-amz"
  },
  "AMAZON": {
    "SIGN_IN_TEXT": [
      "Witamy, Zaloguj się",

    ],
    "SIGN_IN_TITLES": [
      "Amazon Zaloguj się",
    ],
    "CAPTCHA_PAGE_TITLES": [
      "Robot Check",
      "Server Busy"
    ],
    "HOME_PAGE_TITLES": [
                                                         **dont know ...**
    ],
    "SHOPPING_CART_TITLES": [
      "Amazon.pl Koszyk"

    ],
    "CHECKOUT_TITLES": [
    "Kup teraz"
    ],
    "ORDER_COMPLETE_TITLES": [
      "Amazon.pl Dziękujemy"
    ],
    "BUSINESS_PO_TITLES": [
      "Business order information"
    ],
    "DOGGO_TITLES": [
      "Sorry! Something went wrong!"
    ],
    "SHIPPING_ONLY_IF": "FREE Shipping on orders over",
    "TWOFA_TITLES": [
      "Two-Step Verification",
      "Verifica in due fasi"
    ],
    "PRIME_TITLES": [
      "Complete your Amazon Prime sign up"
    ],
    "OUT_OF_STOCK": [
      "Out of Stock - AmazonSmile Checkout"
    ],
    "NO_SELLERS": [
      "Currently, there are no sellers that can deliver this item to your location.",
      "There are currently no listings for this search. Try a different refinement.",
      "There are currently no listings for this search. Try a different refinement.",
      "There are currently no listings for this product in . Try changing the condition type."
    ],
    "FREE_SHIPPING": [
    "DARMOWA DOSTAWA"
    ],
    "ADDRESS_SELECT": [
      "Select a delivery address",
      "Ordine in preparazione",
      "Select a shipping address"
    ]
  }
}
DakkJaniels commented 3 years ago

so to confirm - the bot works for you with those included?

devNostyle commented 3 years ago

i testing,but when condition on price is ok - item dont add in basket .

get msg "no shipping nodes" in bat logs.

i 2 minutes i will send ss

DakkJaniels commented 3 years ago

that's a different issue - need screenshots

DakkJaniels commented 3 years ago

No shipping nodes means it cannot parse the shipping cost so it assumes it is 0.

devNostyle commented 3 years ago

https://i.imgur.com/v3qiffV.png

DakkJaniels commented 3 years ago

it doesn't push that button. Send me the url please.

devNostyle commented 3 years ago

https://imgur.com/6ifJfdh

URL 👍

https://www.amazon.pl/Gigabyte-GeForce-GAMING-karta-graficzna/dp/B08NW2X37Z/ref=sr_1_1?__mk_pl_PL=%C3%85M%C3%85%C5%BD%C3%95%C3%91&crid=2ITE7ADPVB2HU&dchild=1&keywords=rtx+3060+ti&qid=1615671178&sprefix=rtx+3060%2Caps%2C175&sr=8-1

DakkJaniels commented 3 years ago

@devNostyle try using --checkshipping and see if that fixes it. I think it thinks that has a shipping cost associated with it, so maybe it doesn't see it as a valid offer.

devNostyle commented 3 years ago

amazon. bat cmd /k pipenv run python app.py amazon --checkshipping hmm not work.

DakkJaniels commented 3 years ago

What does "not work" mean? what's the error message? show the terminal

devNostyle commented 3 years ago
2021-03-13 23:02:28,837|0.6.1.dev5|INFO|Found 1 offers for B08NW2X37Z.  Evaluating offers...
2021-03-13 23:02:28,854|0.6.1.dev5|DEBUG|Found 1 shipping nodes.
2021-03-13 23:02:28,854|0.6.1.dev5|DEBUG|Empty div found after bottleDepositFee.  Assuming zero shipping.
2021-03-13 23:02:28,854|0.6.1.dev5|DEBUG|   Shipping Price: Price(amount=Decimal('0.00'), currency=None)
2021-03-13 23:02:28,864|0.6.1.dev5|DEBUG|'check_stock' returned False
2021-03-13 23:02:31,864|0.6.1.dev5|DEBUG|Calling check_stock(<stores.amazon.Amazon object at 0x000001F570778D00>, 'B08NW2X37Z', 330.0, 6800.0)
2021-03-13 23:02:32,924|0.6.1.dev5|DEBUG|Initial page title 
2021-03-13 23:02:32,926|0.6.1.dev5|DEBUG|        page url: https://www.amazon.pl/dp/B08NW2X37Z/#aod
2021-03-13 23:02:33,472|0.6.1.dev5|DEBUG|After footer page title Gigabyte GeForce RTX 3060 Ti GAMING OC karta graficzna 8 GB: Amazon.pl: Electronics
2021-03-13 23:02:33,475|0.6.1.dev5|DEBUG|             page url: https://www.amazon.pl/dp/B08NW2X37Z/#aod
2021-03-13 23:02:33,496|0.6.1.dev5|DEBUG|Found a loading flyout div.  Waiting for offers to load...
2021-03-13 23:02:34,012|0.6.1.dev5|DEBUG|After footer page title Gigabyte GeForce RTX 3060 Ti GAMING OC karta graficzna 8 GB: Amazon.pl: Electronics
2021-03-13 23:02:34,013|0.6.1.dev5|DEBUG|             page url: https://www.amazon.pl/dp/B08NW2X37Z/#aod
2021-03-13 23:02:34,025|0.6.1.dev5|INFO|Found 1 offers for B08NW2X37Z.  Evaluating offers...
2021-03-13 23:02:34,041|0.6.1.dev5|DEBUG|Found 1 shipping nodes.
2021-03-13 23:02:34,041|0.6.1.dev5|DEBUG|Empty div found after bottleDepositFee.  Assuming zero shipping.
2021-03-13 23:02:34,041|0.6.1.dev5|DEBUG|   Shipping Price: Price(amount=Decimal('0.00'), currency=None)
2021-03-13 23:02:34,050|0.6.1.dev5|DEBUG|'check_stock' returned False
DakkJaniels commented 3 years ago

Can you add the following to the amazon.py file, around line 804: log.info(f"Item price is {price_float}") image

And then try running again and show me the terminal output.

devNostyle commented 3 years ago
2021-03-13 23:12:33,491|0.6.1.dev5|DEBUG|Initial page title 
2021-03-13 23:12:33,493|0.6.1.dev5|DEBUG|        page url: https://www.amazon.pl/dp/B08NW2X37Z/#aod
2021-03-13 23:12:34,041|0.6.1.dev5|DEBUG|After footer page title Gigabyte GeForce RTX 3060 Ti GAMING OC karta graficzna 8 GB: Amazon.pl: Electronics
2021-03-13 23:12:34,045|0.6.1.dev5|DEBUG|             page url: https://www.amazon.pl/dp/B08NW2X37Z/#aod
2021-03-13 23:12:34,064|0.6.1.dev5|DEBUG|Found a loading flyout div.  Waiting for offers to load...
2021-03-13 23:12:34,576|0.6.1.dev5|DEBUG|After footer page title Gigabyte GeForce RTX 3060 Ti GAMING OC karta graficzna 8 GB: Amazon.pl: Electronics
2021-03-13 23:12:34,577|0.6.1.dev5|DEBUG|             page url: https://www.amazon.pl/dp/B08NW2X37Z/#aod
2021-03-13 23:12:34,586|0.6.1.dev5|INFO|Found 1 offers for B08NW2X37Z.  Evaluating offers...
2021-03-13 23:12:34,603|0.6.1.dev5|DEBUG|Found 1 shipping nodes.
2021-03-13 23:12:34,603|0.6.1.dev5|DEBUG|Empty div found after bottleDepositFee.  Assuming zero shipping.
2021-03-13 23:12:34,603|0.6.1.dev5|DEBUG|   Shipping Price: Price(amount=Decimal('0.00'), currency=None)
2021-03-13 23:12:34,612|0.6.1.dev5|INFO|Item price is 6
2021-03-13 23:12:34,613|0.6.1.dev5|DEBUG|'check_stock' returned False
2021-03-13 23:12:37,613|0.6.1.dev5|DEBUG|Calling check_stock(<stores.amazon.Amazon object at 0x000002DA44F76D60>, 'B08NW2X37Z', 330.0, 6800.0)
2021-03-13 23:12:38,621|0.6.1.dev5|DEBUG|Initial page title 
2021-03-13 23:12:38,624|0.6.1.dev5|DEBUG|        page url: https://www.amazon.pl/dp/B08NW2X37Z/#aod
2021-03-13 23:12:39,164|0.6.1.dev5|DEBUG|After footer page title Gigabyte GeForce RTX 3060 Ti GAMING OC karta graficzna 8 GB: Amazon.pl: Electronics
2021-03-13 23:12:39,166|0.6.1.dev5|DEBUG|             page url: https://www.amazon.pl/dp/B08NW2X37Z/#aod
2021-03-13 23:12:39,185|0.6.1.dev5|DEBUG|Found a loading flyout div.  Waiting for offers to load...
devNostyle commented 3 years ago

ok change min to 1 and going on ! But next problem comes. i send logs w8.

devNostyle commented 3 years ago

it's adding to basket but some other problems comes;

2021-03-13 23:17:27,952|0.6.1.dev5|INFO|Adding to cart
2021-03-13 23:17:27,957|0.6.1.dev5|INFO|Attempting Add To Cart with offer ID...
2021-03-13 23:17:28,947|0.6.1.dev5|INFO|Clicking button
2021-03-13 23:17:28,972|0.6.1.dev5|INFO|Button clicked
2021-03-13 23:17:30,420|0.6.1.dev5|DEBUG|'check_stock' returned True
2021-03-13 23:17:30,420|0.6.1.dev5|DEBUG|'run_asins' returned 'B08NW2X37Z'
2021-03-13 23:17:30,420|0.6.1.dev5|DEBUG|Calling navigate_pages(<stores.amazon.Amazon object at 0x0000021505756DC0>, False)
2021-03-13 23:17:30,422|0.6.1.dev5|DEBUG|Navigating page title: 'Amazon.pl: koszyk'
2021-03-13 23:17:30,422|0.6.1.dev5|DEBUG|title is: [Amazon.pl: koszyk]
2021-03-13 23:17:33,422|0.6.1.dev5|WARNING|FairGame is not sure what page it is on - will attempt to resolve.
2021-03-13 23:17:33,445|0.6.1.dev5|ERROR|'Amazon.pl: koszyk' is not a known page title. Please create issue indicating the title with a screenshot of page
2021-03-13 23:17:33,803|0.6.1.dev5|WARNING|30...
2021-03-13 23:17:34,804|0.6.1.dev5|WARNING|29...
2021-03-13 23:17:35,805|0.6.1.dev5|WARNING|28...
2021-03-13 23:17:36,805|0.6.1.dev5|WARNING|27...
2021-03-13 23:17:37,806|0.6.1.dev5|WARNING|26...
2021-03-13 23:17:38,806|0.6.1.dev5|WARNING|25...
2021-03-13 23:17:39,807|0.6.1.dev5|WARNING|24...
2021-03-13 23:17:40,807|0.6.1.dev5|WARNING|23...
2021-03-13 23:17:41,807|0.6.1.dev5|WARNING|22...
2021-03-13 23:17:42,808|0.6.1.dev5|WARNING|21...
2021-03-13 23:17:43,808|0.6.1.dev5|WARNING|20...
2021-03-13 23:17:44,810|0.6.1.dev5|WARNING|19...
2021-03-13 23:17:45,811|0.6.1.dev5|WARNING|18...
2021-03-13 23:17:46,812|0.6.1.dev5|WARNING|17...
2021-03-13 23:17:47,813|0.6.1.dev5|WARNING|16...
DakkJaniels commented 3 years ago

Did you add the page titles you gave me to your file? the k is lower case in that page title, not upper case like the one you gave me.

devNostyle commented 3 years ago

Yeap it's "Koszyk" on my file I think now it's not pushing next btn "Przejdź do kasy"

https://imgur.com/5RR33tb

DakkJaniels commented 3 years ago

Well did you fix the k so it's lower case like the title in the terminal?

devNostyle commented 3 years ago

my faitgame.conf

    "SHOPPING_CART_TITLES": [
      "Amazon.com Shopping Cart",
      "Amazon.ca Shopping Cart",
      "Amazon.co.uk Shopping Basket",
      "Amazon.de Basket",
      "Amazon.de Einkaufswagen",
      "AmazonSmile Einkaufswagen",
      "Cesta de compra Amazon.es",
      "Amazon.fr Panier",
      "Carrello Amazon.it",
      "AmazonSmile Shopping Cart",
      "AmazonSmile Shopping Basket",
      "Amazon.nl-winkelwagen",
      "Amazon.com.tr Alışveriş Sepeti",
      "Amazon.pl Koszyk"

idk why in terminal show koszyk not Koszyk

v5|ERROR|'Amazon.pl: koszyk' is not a known page title. Please create issue indicating the title with a screenshot of page

how fix this ?

DakkJaniels commented 3 years ago

I'm not sure how else to explain this to you: You wrote: "Amazon.pl Koszyk" The actual page title is: "Amazon.pl: koszyk"

Fix it.

devNostyle commented 3 years ago

omg sry - now works well !