0

How to go about building a website bot?

At my uni, they take an online register for all my classes. I get a little bit bored that I have to log in to my account every single time to sign in to my lecture. I thought of a brilliant idea of programming some bot to log in for me and sign me into lectures. Could someone suggest to me how I could go about it as I'm not sure where to start? Any information will be beneficial, including articles, tutorials and videos. I appreciate any help you can provide.

13th Oct 2020, 10:49 PM
rafalzacher1
3 odpowiedzi
+ 1
If signing in requires answering a captcha or reCaptcha feature to prove you're a human, that would be a major kink in your plan. That aside, you could use Selenium to programmatically open a browser and sign in. Selenium uses one of your installed browsers to more accurately simulate a real person using the site. Selenium is available to many programming languages. A simpler and more elegant solution might exist but I can't say without knowing a lot more about your university's website. The most ideal solution would be accessing an API that they developed to do what you want but that might be known only by your university's IT department or their web developers.
16th Oct 2020, 6:48 AM
Josh Greig
Josh Greig - avatar
+ 1
Rafal, install a version of Selenium and get started with it. Check it at https://www.selenium.dev/downloads/ It is available for Ruby, Java, Python, c#, and JavaScript. Pick whichever language you're most familiar with. I used it for Java and Python but the other languages should be just as good. It gives programmatic control over a web browser like Edge, Chrome, or Firefox to visit websites, set address bar, run JavaScript as if run through the JavaScript console... A lot of people use it for automated testing of websites but it can do what you want. A good first baby step would be writing a program that opens the browser as soon as it runs and does nothing more. Step 2 could be adjusting the program to navigate to your university website. Step 3 could be figure out how to programmatically enter your credentials to sign in. Each step after will likely involve simulated key strokes or using JavaScript to manipulate the document model or simulate clicks. Your program will stop working if the university updates the site a lot but there's no way around that. Knowing your program will need to be updated when their site updates is just something to be aware of.
16th Oct 2020, 8:10 PM
Josh Greig
Josh Greig - avatar
0
Josh Greig thank you for your answer; it's beneficial. My university luckily hasn't employed any feature to detect bots, so I don't have to worry about that particular kink.
16th Oct 2020, 8:44 AM
rafalzacher1