sniffingpickles / Auto-Amazon-Giveaways

Automated Amazon Giveaways using Python3 & Pyppeteer :gift: :snake:
6 stars 8 forks source link

Bot opens giveaways which require a follow, leading to crash #3

Closed dziban303 closed 6 years ago

dziban303 commented 6 years ago

In addition to opening video giveaways, the bot has tried to open a giveaway requiring the user follow an account on Amazon. The bot apparently expects a video, and crashes after 30 seconds when it can't find the button.

I definitely don't want to enter giveaways requiring a follow. If it's fixed, an option to enable or disable these would be excellent, either as a command line switch or a block of code to comment out (without breaking anything else).

Errors below. Note one video giveaway worked (on the third try, see issue report #4) before the bot tried a follow giveaway.


Starting give_it_away_now.py
Log into Amazon...
Processing GiveAway:  Weight Loss Cleanse Program For 15 Days - All Natural Organic - Alkaline Your Body For Healthy & Sustainable Weight Loss Detox, Digestion Support - Powerful Colon, Kidney, Liver & Bowel Cleanser
https://www.amazon.com/ga/p/ccfda0de98898097
    **** Waiting 30 seconds. ****
    **** 30 Seconds is over, Entering Contest. ****
  **** You entered the giveaway but did not win. ****
Processing GiveAway:  Kindle Paperwhite E-reader - Black, 6" High-Resolution Display (300 ppi) with Built-in Light, Wi-Fi
https://www.amazon.com/ga/p/95b040af5356e765
Traceback (most recent call last):
  File "give_it_away_now.py", line 18, in <module>
    asyncio.get_event_loop().run_until_complete(main())
  File "f:\python36\lib\asyncio\base_events.py", line 468, in run_until_complete
    return future.result()
  File "give_it_away_now.py", line 16, in main
    await do_ga_workflow(ga_page)
  File "give_it_away_now.py", line 12, in do_ga_workflow
    await ga_bot.process_giveaways(page)
  File "E:\Auto-Amazon-Giveaways\lib\giveaway.py", line 358, in process_giveaways
    await self.no_req_giveaways()
  File "E:\Auto-Amazon-Giveaways\lib\giveaway.py", line 273, in no_req_giveaways
    await self.display_ga_result(prize_page)
  File "E:\Auto-Amazon-Giveaways\lib\giveaway.py", line 166, in display_ga_result
    await prize_page.waitForSelector('.qa-giveaway-result-text')
  File "f:\python36\lib\site-packages\pyppeteer\frame_manager.py", line 796, in __await__
    yield from self.promise
pyppeteer.errors.TimeoutError: Waiting failed: timeout 30000ms exceeds.
sniffingpickles commented 6 years ago

I'll add syntax for follows this evening. (8 hours from now). I forgot to add it to the if statements, the query is there.

Pille88 commented 6 years ago

you can add these three lines in no_req_giveaways

follow_button = await prize_page.querySelector('#ts_en_fo_follow')

elif follow_button: await follow_button.click()

dziban303 commented 6 years ago

In #10, I added code to enter follow giveaways and also to just close the page without entering.

When you follow users on Amazon, you'll get emails from Amazon about their latest activities. That might be ok for someone you actually care about, but for these random giveaways it's just obnoxious spam, and you have to unfollow each account individually. So for me, it's best to just not enter these giveaways at all.