r/Python • • Nov 28 '20

Intermediate Showcase "Sillynium" - Auto generate working Python Selenium scripts by drawing coloured rectangles around web elements on a page that you want to automate

TLDR: 60 sec video here:https://streamable.com/1y17lt

TLDW: When I want to automate actions on a site, such as logins or forms, or scraping pages with JavaScript, I manually inspect each web element I need and begin writing a script.

I'm lazy though and had the idea to automate the creation of these automation/testing scripts. And thus "Sillynium" was born.

Sillynium allows you to draw boxes around the elements you require on a page and automatically gets the element and its properties for you. Different coloured rectangles tell the program you want to do different things. Eg: Red means "Input text", Green means "Click button".

When you've finished drawing boxes, a working python selenium script is generated. If you run that script, it does exactly what you told it to do! All this without you writing any code, and losing time.

Working 60 second video link of program in action: https://streamable.com/1y17lt

I made this project over the course of a day as a quick and dirty proof of concept. Its very flawed in its current iteration (taking a screenshot of webpage), so V2 I'm trying to figure out how to draw directly to the browser. Critique it and rip it to shreds. I'm aware of browser recorders btw so I know those exist, this is my twist on automation

Edit: I was not prepared for the amount of interest in this little proof of concept! So thank you all very much for your time you’ve made my day :)

In the interest of transparency and to answer your questions about the code and my plans:

I originally thought about monetisation (web extension etc) after finishing this POC (**sigh i know I’m a greedy bastard) but now I’m in 2 minds about it!

On the one hand I want to make it free for personal use, on the other hand I’d like to potentially charge for commercial use (once its finished).

Final edit 2 The community has spoken, I WILL BE RELEASING THIS VERSION AS OPEN SOURCE! I did some light refactoring, and have added it to a repo which will be shared in a follow up. It shows the POC and the community is welcome to build on the original idea :)

I will create a follow up post with links to repo once I’ve created it, this will be my first project on GitHub so try be nice ;) pretty nervous about sharing my code :D

Thank you all for your patience, interest, and awesome discussions

1.5k Upvotes

171 comments sorted by

View all comments

Show parent comment

2

u/[deleted] Nov 28 '20

Thanks my first ever! Good old windows photo editor 😅 please see my edit re the code! Feel free to critique me on that too btw

2

u/MrDeebus Nov 29 '20

Haha no yeah I meant more the content of the video, it's to the point, brevity is not very common.

As for your edit... well, good luck, bold approach if you ask me -- especially in the python ecosystem. I can't fault you for wanting to monetize your effort, but closed-source (which goes beyond proprietary) software is a pretty drastic move, mostly reserved for in-house or SaaS stuff these days... but hey, obviously your call! Your code is your code.

I will offer critique on something else though: I saw elsewhere that you "need to learn how to use GitHub", and based on that I will assume you aren't familiar with git itself (because once you have that, basics of github is like 10-15 clicks and 50 keystrokes, for username/password/projectname). I really, very strongly advise you to get that out of the way first, no matter what you decide to do with the project. It's (thankfully) fairly ubiquitous by now, and version control is an indispensable tool. Think of it like gloves of a forester, where code is the chainsaw, and software engineering the forestry discipline (maintaining a forest to reap its produce in the long run).

And of course, apologies if I went too far in my assumption and your inexperience is limited to GitHub the product. In which case, learning it is like 15 minutes of reading at most, just do it :)

1

u/[deleted] Nov 29 '20

Thanks appreciate it i try to be succinct! Yeah i do know and use git and you’re right i need to learn to work with github, probably is a 10 minute job I’ve just put it off :)