Automate webpage tasks without having to have a browser open?
<p>I know about tampermonkey/greasemonkey and have used it a fair bit, but now my task is to write a program that runs in the background and automates mundane tasks (clicking buttons, typing into input fields etc.) on a specific webpage. Running a browser in the background takes too much RAM and processing power, so I'm looking for an alternative.</p>

<p>So far I've found <a href="http://www.seleniumhq.org/" rel="nofollow">selenium</a>, but after a bit of research it looks like that it requires to have a browser open at all times as well (or maybe not? the documentation isn't that good). I thought about python scripts too, but I don't have any experience with those nor have I any idea if they can handle anything that's not basic html. If they can, does anyone know of a good tutorial for python scripts? I have used that language a few years ago, so I shouldn't really have a problem with python itself.</p>

<p>If python scripts aren't ideal either, is there a (preferably somewhat simple) way I could achieve what I want? </p>

<p>It depends on whether you want a script that interacts with a web UI, or a script that automates web requests.  Do you <em>really</em> need to click buttons and type into input fields?  Presumably, the data from those buttons and input fields is eventually sent to a web server.  You could skip the entire UI and just make the requests directly.  You don't need a browser for that and python is fine for doing these types of things (you don't even need <code>selenium</code>, you can just use <code>requests</code>)</p>

<p>On the other hand, if you're trying to test out the UI of a web page, or you actually need to interact with the web UI for some other reason, then yeah, you'll need an application (like a web browser) that's capable of rendering the UI so you can interact with it.</p>

python selenium automation