Selenium Is Not A Sedative

Selenium Is Not A Sedative

Scripting and automation have long been favorite pastimes of mine, Selenium and AutoHotkey in particular. If you have never worked with them it is easy to disregard or misunderstand them, which is why I want to show you all the cool things you can do with Selenium today.

Now, if I have five minutes of your attention, may I sell you some snake oil? Here’s why Selenium is the next best thing since sliced bread:

Selenium is prescription free and readily available

If by the end of this post you are convinced of Selenium’s calming effect on your nerves then you can head over to your nearest browser and download your fix completely for free.

Which is to say: Selenium costs nothing, the drivers for Chrome, Firefox are ready to be downloaded and there is all the free documentation you might want to read through.

It’s also big enough a technology that every problem has been solved by now, which to me is always a great aspect to any technology that is new to me.

It’s easy to administer

Selenium is very powerful, but also very simple for a lot of usecases. In its easiest form there are three components:

  • Start the browser window / session
  • Find elements by their ID, name, css class
  • Click them / Enter text

With those basic steps you can already automate a great many things, those are basically the things you as a user would do for most any task.

And if that wasn’t simple enough you can also get a Chrome plugin that lets you record actions / macros and then export them to Python or Java code at the click of a button. There is your finished script.

Selenium is one strong and potent technology

I like integrating Selenium with Python, but Java is another often-used choice. Whichever of these you choose it gives you great options for powerful scripts. Example?

Have a python script run on an endless loop and whenever it detects a new entry in an RSS feed of your choosing it then shares the link within that to reddit, Pinterest, tumblr or what have you.

You can also make use of try-catch blocks that allow you to run a script pretty much unattended when you are fine with the occasional post not coming through or whatever. If you need more detailed error handling you can do that, as well because remember, we are in a full-blown programming environment here and you can do anything from sending alert emails to trying again after a timeout.

Related  What I Learned During My Programming Job Hunt In The Middle Of A Pandemic

It’s certainly addictive, but has no side effects

One moment you’re all like I’ll just try this out once and then the next day you start automating your daily recurring tasks, get your daily news and daily stats and send out an automated email to remind your friends that you get way more moolah than they do from all the automation scripts.

And the good part here? Nothing bad will come of it, apart from a few lost friends, hours spent debugging scripts and more hours learning how to save cookies to circumvent recaptchas during login. And everyone past their thirties will tell you that friends aren’t important anyway and how they wish they had spent more time in their twenties trying to make money.

But hey, this is a life skill that can earn you actual money if you know people with annoying recurring tasks.

Selenium can safely lose its head

One of the best parts about using Selenium is that each script will run in its own isolated instance — you can keep using your computer while the script runs. You can even run a second, fifth script at the same time assuming your computer can handle that load.

And you can even use another browser window at the same time to do actual surfing. This is called headless mode, a real amazeball for anyone who doesn’t like giving up control over their computers and do something else instead for an hour or two.

Summary: Ask your doctor whether Selenium is right for you

I hope I managed to get you a taste of how powerful Selenium actually is, and how much unused potential there is both for yourself and also for friends and family, at work even.

Here’s what other customers are saying:

Selenium saved me hours of time each week and did wonders on my sanity

I don’t know how I would get through the day without these scripts that make my bosses think I’m hyper-productive when really all I do is surf the internet.

Related

Comments

No Comments Yet!

You can be first to comment this post!

Post Reply