whole-foods-deliverance
whole-foods-deliverance copied to clipboard
Add support for multiple day / multiple delivery option regions
Issuing the following command, it dumps out at the delivery times: python run.py -s 'Amazon Fresh' -c --debug
DEBUG:urllib3.connectionpool:http://127.0.0.1:51412 "POST /session/b2ebca87c5b21e30059084b779d79d97/element HTTP/1.1" 404 1867
DEBUG:selenium.webdriver.remote.remote_connection:Finished Request
DEBUG:selenium.webdriver.remote.remote_connection:POST http://127.0.0.1:51412/session/b2ebca87c5b21e30059084b779d79d97/element {"using": "css selector", "value": ".ufss-slotselect-container"}
DEBUG:urllib3.connectionpool:http://127.0.0.1:51412 "POST /session/b2ebca87c5b21e30059084b779d79d97/element HTTP/1.1" 404 1867
DEBUG:selenium.webdriver.remote.remote_connection:Finished Request
DEBUG:selenium.webdriver.remote.remote_connection:POST http://127.0.0.1:51412/session/b2ebca87c5b21e30059084b779d79d97/element {"using": "css selector", "value": ".ufss-slotselect-container"}
DEBUG:urllib3.connectionpool:http://127.0.0.1:51412 "POST /session/b2ebca87c5b21e30059084b779d79d97/element HTTP/1.1" 404 1867
DEBUG:selenium.webdriver.remote.remote_connection:Finished Request
ERROR:utils:Timed out waiting for target element: ('class name', 'ufss-slotselect-container')
INFO:utils:Dumping page source to: source_dump_1586829983526.html
DEBUG:selenium.webdriver.remote.remote_connection:GET http://127.0.0.1:51412/session/b2ebca87c5b21e30059084b779d79d97/source {}
DEBUG:urllib3.connectionpool:http://127.0.0.1:51412 "GET /session/b2ebca87c5b21e30059084b779d79d97/source HTTP/1.1" 200 547930
DEBUG:selenium.webdriver.remote.remote_connection:Finished Request
Traceback (most recent call last):
File "run.py", line 183, in
I suspect this was due to an out of stock alert - did you notice one displayed after the error? It should have also dumped the page source. Would you mind providing it here so I can debug? (be sure to redact any personal information on the page)
https://gyazo.com/b58f51cb5fa85b4f92ad4e069975cbd2
Ah, looks like the slot containers are different in your area - would you mind providing that page source (source_dump_15xxxxxxxxxx.html
) via pastebin or similar?
@teckboy Glad to hear you're getting some utility out of this and you're able to help your family! I'll look into the source you provided and make some adjustments. Will reference this issue when I've got a fix
@mark-thompson did you already have a sample dump? if not, I can provide one
@BenMQ I did receive a few, yes, but none with open slots. if you happen to find an open slot and can send the source of that page (or at least the XPath/CSS selector logic for the slot/button) for testing, I'd appreciate it.
@teckboy @BenMQ @BrendanBTO Just pushed a quick temp fix that should at least notify you when slots are available. This worked on the source provided by @teckboy , but I'm unable to test on the live site, as I am apparently not yet on the guest list for Amazon Fresh. Auto-checkout and preferences won't work, but if you end up finding a slot, the page source will be dumped and I should be able to add that functionality fairly quickly
@teckboy @BenMQ @BrendanBTO Just pushed a quick temp fix that should at least notify you when slots are available. This worked on the source provided by @teckboy , but I'm unable to test on the live site, as I am apparently not yet on the guest list for Amazon Fresh. Auto-checkout and preferences won't work, but if you end up finding a slot, the page source will be dumped and I should be able to add that functionality fairly quickly
Got one!!!
[2020-04-20 05:57:38] {_make_request} DEBUG: http://127.0.0.1:64054 "GET /session/2b437aee2ef97aaf72185969824bdbe2/source HTTP/1.1" 200 568564
[2020-04-20 05:57:38] {_request} DEBUG: Finished Request
Traceback (most recent call last):
File "run.py", line 232, in
source_dump-gp-buy-shipoptionselect-handlers-display_20200420T095738Z.rtfd.zip
For me its erroring out with the same message. Expected 1 date element but found 0.
@teckboy Excellent! Would you mind sending that as html or .txt? RTF changes the formatting such that I can't parse the HTML tags.
@BrendanBTO Could you run with --debug
and provide the source?
@mark-thompson Here's the source HTML. I edited it to remove all appearances of names, addresses, etc. source_dump-gp-buy-shipoptionselect-handlers-display_20200420T235136Z_Edited.html.zip
@teckboy @BrendanBTO Thanks! Check back in the next day or so for updates
@teckboy @BrendanBTO Give the new version a try. It should be able to detect open slots and may even check out for you, assuming the XPATH logic for the continue button is correct. Run with debug and let me know how it goes