Lets make a python bot :) part 1 for beginners :))
😎💻 bots r cool :)
Ok guys this is the second time I'm writing this!!!
We are making a bot today with python. This aint no discord bot. Nonono! this is a web bot (or whatever thats called)
This tutorial will be shorter than the last because even I dont have that large of an attention span in a tutorial and I want people to learn from what I make
Our bot will search up in repl answers and get an answer(the first) for our question that we type in our bot
Lets get our hands dirty with some code now
we need selenium as the webdriver library for this project.
First you need to install it by writing this in your cmd/terminal:
now write this in your file:
get the question
Now we need the question that the user wants to search ->
Thats how python gets inputs.
Now that we have that lets get our driver
First download firsfox cus thats what we are using here and trust me you will thank me (even tho I'm using chrome while writing this)
Now get the gecko driver for firefox (what we need for the automation) from here:
Now get the path of the driver (gecko driver) the web driver that you just downloaded and put this in your code:
My path was something like this : driver = webdriver.Firefox(executable_path = '[path]/geckodriver-v0.26.0-win64/geckodriver.exe')
get the link!!!
Here we can actually search something on replit by entering a link! like this :
we are going to take advantage of this hahaha to do that we can easily just write this:
So done now!
clicking on the question to load it in
Now I searched up al lot of these answers and I got a css selector. I have it ready for you in this code so you need not do the work but you should know that its quite easy to do from the devtools :)
here is the code:
Now thats all for this lesson. here is all the code together:
Now this is a start of what (hopefully) will be a series. I need your inputs from the comments section on what to do now :)
also dont try this on replit do it locally because it doesnt work on replit...
Thats it for today and happy coding
@mkhoi @Jakman @techgeek680 @TheForArkLD @DynamicSquid the next part of this tutorial is out at https://repl.it/talk/learn/lets-make-a-bot-python-series-part-2-TIC-TAC-TOE/43409 if you missed it. I'm creating the third part which is supposed to an epic end to the bot series :) But cant make any promises. The code can go south at any moment...