Can JavaScript be used to automate browser and things outside browser?

the reason i want to learn javascript is because i would like to automate some things i do in the browser and the computer an example is .

on a website click a button , go to the next page , click another button , go to the next page copy bitcoin amount & copy bitcoin address , then go to my bitcoin wallet which is on my desktop and send the amount of bitcoin to that address , and then repeat this process again .

i was wondering if this is possible in javascript , if not what programming language would do this?

There are various Node library that help you automate a web browser, they are mainly used either to automate manual stuff or for testing website behavior in a real-life case.

The one I heard the most of is called Puppeteer.

That said, I am fairly sure that there are library like this one for every other programming language, meaning that if you are more confident with another, you don’t “have to” learn JS just for the sake of using a tool like this one.

Hope it helps. :sparkles:

1 Like

you may also want to check if that website has an API, as that makes it just easier

1 Like

There are multiple browser automation frameworks whose interface is either in JavaScript or have JS bindings. Puppeteer has been mentioned. Playwright is very similar, also good and is designed more for what you are asking about. Selenium is the most common.

But including desktop applications in that… bridging the gap between them…that’s not very common. If the desktop wallet application is an Electron app (not unlikely), then that is also effectively a browser and should expose the same API, so a browser automation framework in theory should be able to handle it. If it isn’t, there are desktop automation frameworks for testing, and one or two of those may have JS bindings. It’s not really a massive issue if they don’t have bindings, just means you need to learn the commands required. If you’re on a Mac, then it comes with its own automation framework (on Windows I’ve got no idea, but I assume not) so you can write scripts using the language that framework uses, then execute that script from the Node script via spawn or exec. How you pass the data, not sure – easiest I guess is just write to a text file with the browser scripting, then read from that text file when the desktop automation kicks in

1 Like

Allow me to throw in for Cypress, which knocks Selenium into a cocked hat. But like the others, it’s also meant for testing, not application logic.