sniffingpickles / Auto-Amazon-Giveaways

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

Cannot read property 'textContent' of null #17

Open dziban303 opened 5 years ago

dziban303 commented 5 years ago

Apparently the same issue as #16. I'm creating a new issue because that ticket lacks the whole error. This started a few days ago, apparently caused by a change in Amazon's HTML.

It usually, but not always, occurs just after login and after the giveaway matrix page loads.


Starting give_it_away_now.py
Log into Amazon...
Traceback (most recent call last):
  File "give_it_away_now.py", line 18, in <module>
    asyncio.get_event_loop().run_until_complete(main())
  File "C:\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 "C:\linux\Auto-Amazon-Giveaways.new\lib\giveaway.py", line 388, in process_giveaways
    await create_ga_prize(giveaway)
  File "C:\linux\Auto-Amazon-Giveaways.new\lib\giveaway.py", line 362, in create_ga_prize
    prize_name_element
  File "C:\Python36\lib\site-packages\pyppeteer\page.py", line 810, in evaluate
    return await frame.evaluate(pageFunction, *args, force_expr=force_expr)
  File "C:\Python36\lib\site-packages\pyppeteer\frame_manager.py", line 272, in evaluate
    pageFunction, *args, force_expr=force_expr)
  File "C:\Python36\lib\site-packages\pyppeteer\execution_context.py", line 44, in evaluate
    pageFunction, *args, force_expr=force_expr)
  File "C:\Python36\lib\site-packages\pyppeteer\execution_context.py", line 85, in evaluateHandle
    helper.getExceptionMessage(exceptionDetails)))
pyppeteer.errors.ElementHandleError: Evaluation failed: TypeError: Cannot read property 'textContent' of null
    at <anonymous>:1:45```
xBlackPoison357x commented 5 years ago

Found a workaround/cause. When you launch the application and then click the signin button before it automatically loads that page it causes this issue. The workaround is not to touch anything until the console starts spamming please login to touch anything.

jaredpavan commented 5 years ago

I know it's been a while, but this issue persists even when touching nothing.


  File "give_it_away_now.py", line 18, in <module>
    asyncio.get_event_loop().run_until_complete(main())
  File "/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 573, 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 "/Users/jaredpavan/Downloads/Auto-Amazon-Giveaways/lib/giveaway.py", line 382, in process_giveaways
    await create_ga_prize(giveaway)
  File "/Users/jaredpavan/Downloads/Auto-Amazon-Giveaways/lib/giveaway.py", line 356, in create_ga_prize
    prize_name_element
  File "/usr/local/lib/python3.7/site-packages/pyppeteer/page.py", line 1158, in evaluate
    return await frame.evaluate(pageFunction, *args, force_expr=force_expr)
  File "/usr/local/lib/python3.7/site-packages/pyppeteer/frame_manager.py", line 295, in evaluate
    pageFunction, *args, force_expr=force_expr)
  File "/usr/local/lib/python3.7/site-packages/pyppeteer/execution_context.py", line 55, in evaluate
    pageFunction, *args, force_expr=force_expr)
  File "/usr/local/lib/python3.7/site-packages/pyppeteer/execution_context.py", line 114, in evaluateHandle
    helper.getExceptionMessage(exceptionDetails)))
pyppeteer.errors.ElementHandleError: Evaluation failed: TypeError: Cannot read property 'textContent' of null
    at __pyppeteer_evaluation_script__:1:45```
sniffingpickles commented 5 years ago

I'm not really updating this anymore, sorry. Lost interest

tuxedocurly commented 5 years ago

Said every maintainer of every branch of this project ever :P

On Thu, Jan 3, 2019, 4:30 PM Evan H <notifications@github.com wrote:

I'm not really updating this anymore, sorry. Lost interest

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sniffingpickles/Auto-Amazon-Giveaways/issues/17#issuecomment-451311460, or mute the thread https://github.com/notifications/unsubscribe-auth/ADRdr7c5_EiDavMgSupa_ihFNXbXXxpiks5u_pKVgaJpZM4WSUXh .

jaredpavan commented 5 years ago

Haha, I don't blame you. The giveaways are pretty meh.

Thanks for the initial contributions, anyway!

sniffingpickles commented 5 years ago

That looks like a pyppeteer error though, you may want to just double check it's all update to date

sniffingpickles commented 5 years ago

btw, the only things i've won doing this was a dress for a 6 year old girl, and a few books. I think I entered something like 44,000'ish giveaways in the 4 months i kept it running.