I Coded A Checkout Bot To Buy High Demand Products in Seconds!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
imagine creating a checkout bot that can check out a product in seconds i'm going to do that in this video we all want to get the limited items that drop and sell out within seconds and the only way we can do this is by using a buy now some of us can buy a bot so why not just create our own now creating a bot is easier said than done worst thing that can possibly happen is you have a bot and when you run it it blows up your cpu to avoid that you need to pick the best framework to use to create your bot so let's do some research and let's find this framework i think we found our winner so the core of our buy is going to be its ability to access the html of the page and interact with elements based on the passed in attributes of whatever element that we want puppeteer to either click or type in etc etc because at the end of the day we want our bot to behave exactly like a user so the fastest way to do that is by using the chrome developer tools and what this allows you to do is literally get the html of any element on the page so we want puppeteer to click this button add to cart and the only way we can do that is by telling puppies hey i want you to click the specific element this element that has this class name so we're going to use the class to identify the element so remember how i said we need a weight of telling puppeteer hey i want you to click this element and we copy the class of the add to cart button but what we're going to do is pass in the class name and the quotations bracket and it's going to get that element and what we want puppeteer to do is click that element right you want to click the button so we do that and if i run this program now what it should do is it should click add to cart and there you go now all we have to do is repeat this process for all the buttons up until we get to the billing information page you guys saw how fast wrote that code that's called post editing so at this point in the program what we did is we clicked all the buttons that will get us to the delivery page so this is the last button that we click what should happen is it should take us to this page right here so let's run this program again and see what happens ctrl rc run it and i'll see exactly what happens so it has to cart foreign [Music] buggy [Music] we got it so because these elements have ids we're just going to grab each element in this form using its corresponding id instead of his class just because identifying element by its id is much simpler and more trustworthy so i realize we're going to run to a problem what puppeteer does is it types in whatever you wanted to type in whatever field but for city and zip code there is already text in it what puppeteer is going to do is say we live in the city baltimore it's going to do this and that's obviously wrong so we have to find a way of somehow clearing the text so that we can write baltimore wow look how smart that is i love stack overflow so i think we have delivery done so we're gonna test that right now [Music] there you go so now we just click this button we already know how to do that and then we move on to the payment section what we have to do for the payment section is it's just the same process really get the html element of card number and cvv as well as expiration dates and just click review your order so let's do that real quick [Music] [Applause] you want to always have some type of delay just so you don't accidentally type in a field that doesn't exist yet [Music] so i wrote all the code i should fill out all the information for these fields right here including card number cv month and year phone number is ready for down now i just need to click this button that click okay so now [Music] let's go so now we got to the place order page guys so now we're literally one click away from checking out a product within seconds i wrote the last line of presumably this entire program so what it should do is click this place order button and it should check out the product now if you guys really want to test you can put in your real credit card number but again i use a fake credit card number got online so if i click place order like if you look at this right here it's going to take us back to the payment page see right here because fake credit card number whoops now we're going to use our program to test this and if it does the exact same thing then we know that we have successfully created a checkout bot all we have to do is run the program one more time and see if it takes us back to the payment page if we click place order or if you put your real credit card number in it should say order successful right [Music] here okay guys let's click your order click place order and it will take us back you get it if you guys put your real credit card number in it should check the product out successfully we did it guys we created a bot that can check our product in seconds and before i explain the last part i want you guys to leave a like and comment down below if you want me to make more videos like this now my last comment is this box can be optimized further it can be made even faster and the way to do that is by decreasing the delays i set throughout this program which is denoted as a page that i wait for line so if you guys enjoyed this video again leave a like and thank you guys all for watching peace out dude peace out dude peace
Info
Channel: Ritesh Verma
Views: 82,076
Rating: undefined out of 5
Keywords: Writing a program to checkout limited items, writing a program, writing a checkout bot, checkout limited items in seconds, creating a program, computer science, programming projects, computer programming, coding, coding bots, how to code, how to make a bot, how to code a bot, checkout bot
Id: h1vQb9ZIlMo
Channel Id: undefined
Length: 7min 51sec (471 seconds)
Published: Fri Jan 08 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.