Live data from Hacker News

Show HN: I created a browser automation tool

rocketride.io

31–40 of 56 posts

Re: Show HN: I created a browser automation tool

#32
post #10
post #7

There's a chrome extension that records all your steps and then generates a puppeteer/playwright script for you. Then you can just edit bits of that script and run it. This is my go-to method presently. I feel like you could incorporate some of those features into this and eliminate some of the manual entry of css selectors.

I just started using a Selenium IDE + selenium-side-runner for headless automation. Is puppeteer or Selenium a more widely supported tool?

Selenium is more widespread but I recommend Playwright as the most modern automation library. Comes with plugins for making your automations more... nimble.

Re: Show HN: I created a browser automation tool

#33

Earlier quoted context omitted.

You can do it in the chrome browser tools! There's a record section. Note if you're doing this for automation testing it's going to be pretty flakey and you're better off following best practices and using custom testing selectors instead :)

Why is it flakey for automation testing though? In my experience that's basically targeting page elements and interacting with them. Doesn't this do the same thing?

It uses a combination of xpaths that are like body[1]div[2]div[1]p[2]button[1] so if you edit the UI it'll break, or worst case they do X,Y coordinates of clicks on a page so if the UI changes it'll break. Sometimes it'll get your ID or Name or whatever but some frameworks randomize these on compilation and some devs change them as part of refactoring.

Best practice is to add test attributes to the HTML elements (such as data-testid="SubmitButton") so if the page is moved around or the button is edited the tests remain stable. There's a lot of good online sources on making UI testing somewhat more reliable :)

Re: Show HN: I created a browser automation tool

#35
post #34

Only tangentially related, but... I use Firefox. Anyone know of a way I can have it close all tabs once a day? Either via an external script or an extension?

Selenium would do that, in python, no worries.

Alternatively, have a batch script that just runs (Assuming windows) taskkill /f /im firefox.exe which would kill it. Then have firefox startup with no tabs loaded.

Re: Show HN: I created a browser automation tool

#36
post #19

> Periodically check for changes I remember a Firefox extension that notified me with the diffs of changed pages. I don't remember exactly what I was using it for. I think something related to CVEs for some keywords. Then the service I was using shut down and I lost tracks of that extension.

Update Scanner. I use it a lot to track airline prices/sales.

Re: Show HN: I created a browser automation tool

#37
post #7

There's a chrome extension that records all your steps and then generates a puppeteer/playwright script for you. Then you can just edit bits of that script and run it. This is my go-to method presently. I feel like you could incorporate some of those features into this and eliminate some of the manual entry of css selectors.

FYI this is now built into the Chrome devtools "Recorder" panel.

Re: Show HN: I created a browser automation tool

#38
Best of luck.

Two things that have tripped me up 1. "and save the value of this attribute", it wasn't clear that this could only be certain values, text, id. 2. API I can list tasks, get the status of a task, start tasks via API, but I don't se how I can read the results / stored data

Re: Show HN: I created a browser automation tool

#40
post #19

> Periodically check for changes I remember a Firefox extension that notified me with the diffs of changed pages. I don't remember exactly what I was using it for. I think something related to CVEs for some keywords. Then the service I was using shut down and I lost tracks of that extension.

Update Scanner. I use it a lot to track airline prices/sales.

It could be this one. I remember the yellow highlights.

It was many years ago and definitely not a cloud service so not Distill Web Monitor. It didn't let me define fields to monitor, so not PageProbe.

I wouldn't have used a cloud service. What's the point? My browser already have everything it takes to download pages and diff them. I understand that if the computer is off the browser won't monitor the page but it was ok with my use case: if it's off I won't be able to react to the CVE.

And for other use cases, it's no business of anyone else but me to know what I'm monitoring.

Post reply on HN