LeninGangwal / Big-Basket-Delivery-Slots

Automates the process of finding delivery slots in BigBasket during the Covid-19 chaos.
41 stars 16 forks source link

The success check in the script doesn't seem to be a valid check to see if slots are open #3

Closed rushi closed 4 years ago

rushi commented 4 years ago

This particular line in the code doesn't seem to be a good check to see if slots are available https://github.com/LeninGangwal/Big-Basket-Delivery-Slots/blob/0e2a5c3420f64c315d74c2133dd04aeddbf56bf0/BB_slot.py#L25

I've been running this script for a while, and finally the page redirected to https://www.bigbasket.com/co/checkout/?x=0&spni=21&addr=someid which according to the code indicates that slots are open, but the page instead showed this error:

Screenshot 2020-04-10 at 17 46 49

So this if condition doesn't seem to work. Is there a better check that can be done? I haven't had a successful order on Big basket so I don't what a good check would be.

LeninGangwal commented 4 years ago

You are right! I added the fix for that. Thanks for pointing it out.

rushi commented 4 years ago

Hi again @LeninGangwal,

I pulled the latest changes, and this particular line doesn't seem todo the trick.

https://github.com/LeninGangwal/Big-Basket-Delivery-Slots/blob/c369655caff86a05b659e113541efae7f05b9cdd/BB_slot.py#L27

Here's a screenshot from my system showing the Bigbasket website and script output side-by-side

Big_Basket_Delivery_Slots

I'm going to dig around and try to find a fix, but Python isn't my cup of tea, so any help would be appreciated.

LeninGangwal commented 4 years ago

Hmm got it. This should not happen ideally unless your internet is quite slow and the popup loads up after the 5 sec sleep time. I 'll try to update the script, but for now, you can try increasing the sleep time to say 15 seconds maybe. time.sleep(5) #driver take a few secs to update the new URL

rushi commented 4 years ago

Ok I've bumped that to 45 seconds to give it plenty of time. I'll keep the script running and get back to you

rushi commented 4 years ago

After some trial and error a sleep of 20 seconds did the trick. No failures so far, and I finally got a slot 🎉

LeninGangwal commented 4 years ago

Greaat 👍