Remix.run Logo
dataviz1000 11 hours ago

I use Playwright to intercept all requests and responses and have Claude Code navigate to a website like YouTube and click and interact with all the elements and inputs while recording all the requests and responses associated with each interaction. Then it creates a detailed strongly typed API to interact with any website using the underlying API.

Yes, I know it likely breaks everybody's terms of service but at the same time I'm not loading gigabytes of ads, images, markup, to accomplish things.

If anyone is interested I can take some time and publish it this week.

bredren 10 hours ago | parent | next [-]

I also do this. My primary use case is for reproducing page layout and styling at any given tree in the dom. So, capturing various states of a component etc.

I also use it to automatically retrieve page responsiveness behavior in complex web apps. It uses playwright to adjust the width and monitor entire trees for exact changes which it writes structured data that includes the complete cascade of styles relevant with screenshots to support the snapshots.

There are tools you can buy that let you do this kind of inspection manually, but they are designed for humans. So, lots of clickety-clackety and human speed results.

---

My first reaction to seeing this FP was why are people still releasing MCPs? So far I've managed to completely avoid that hype loop and went straight to building custom CLIs even before skills were a thing.

I think people are still not realizing the power and efficiency of direct access to things you want and skills to guide the AI in using the access effectively.

Maybe I'm missing something in this particular use case?

AlphaSite 6 hours ago | parent [-]

its mostly because MCPs handle auth in a standardised way and give you a framework you can layer things like auth, etc on top of.

Without it youre stuck with the basic http firewall, etc which is extremely dangerous and this is maybe the 1 opportunity we have to do this.

halJordan 9 hours ago | parent | prev | next [-]

I love how HN is loving this idea when it's the exact same thing Anthropic and OpenAi (and every other llm maker) did.

It's God's gift to them when it lets them bypass ads and dl copyrighted material. But it's Satan's curse on humanity when the Zuck does it to train his llm and dl copyrighted material.

deaux 8 hours ago | parent | next [-]

Both scale and purpose make them completely different things. You're acting as if they're the same when they're not.

eipi10_hn 6 hours ago | parent | prev | next [-]

I won't comment about dl but ads are trackers and spyware for me. I don't spy on websites' owners, I have my human rights to stop those trackers.

Zuck serves ads/spywares to other users, he deserves to taste his own medicines, not me.

friendzis 2 hours ago | parent | prev | next [-]

You can see this pattern in many different topics: updoots are highly correlated with a positive answer to "do I personally get to profit"?

achierius an hour ago | parent [-]

Yes, and? People need to eat. Billionaires are generally not interested in whether or not the average Joe gets to eat.

cyberax 5 hours ago | parent | prev | next [-]

I would love to pay for content. I'm _paying_ for YouTube Premium.

But heck. Do I hate the YouTube interface, it degraded far past usability.

zx8080 4 hours ago | parent [-]

Write to their support. Oh, wait.

tclancy 8 hours ago | parent | prev [-]

So you’re that Hal Jordan then? Why would a Green Lantern feel the need to defend either? I feel like the Guardians would not accept your arguments as soon as you got to Oa, poozer. I guess what I am saying is don’t have a famous name. Seems obvious.

llbbdd 7 hours ago | parent [-]

OP appears to be talking about real life. What are you on about?

bryanrasmussen 6 hours ago | parent [-]

the user name he is responding to is HalJordan, Hal Jordan is the name of a comic book superhero: Green Lantern, a moral paragon.

on edit: he is evidently being "sarcastic"

Axsuul 11 hours ago | parent | prev | next [-]

Why even use Playwright for this? I feel like Claude just needs agent-browser and it can generate deterministic code from it.

dsrtslnd23 10 hours ago | parent | next [-]

you mean this one? https://github.com/vercel-labs/agent-browser

dataviz1000 10 hours ago | parent [-]

It is 2 months old!

My excuse for not keeping up is that I'm in so deep that Claude Code can predict the stock market.

I'll still publish mine and see if has any value but agent browser looks very complete.

Thank you for sharing!

Barbing 4 hours ago | parent | next [-]

>I'm in so deep that Claude Code can predict the stock market.

“What?”, more polite than “yeah right” :)

(oh I guess obviously it would have a chance at nailing it for weeks in a row, and have more good years than bad—since actively managed funds can pull that off until, universally, they can’t [beat the market])

bartek_gdn 10 hours ago | parent | prev | next [-]

Yes please, maybe there will be some solution that will fit the problem better! I recently released something similar, and because of the small API, I'm more comfortable using it.

https://news.ycombinator.com/item?id=47207790

citizenpaul 5 hours ago | parent | prev [-]

>I'm in so deep that Claude Code can predict the stock market.

What?

thefreeman 7 hours ago | parent | prev [-]

You can just start claude with the —chrome flag too and it will connect to the chrome extension.

3abiton 2 hours ago | parent | prev | next [-]

I always used playwrite as an alternative to selenium, relatively surprised by its ability to interface with LLMs.

schainks 10 hours ago | parent | prev | next [-]

Very interested. Would even pay for an api for this. I am doing something similar with vibium and need something more token efficient.

hugs 4 hours ago | parent [-]

have you tried vibium's cli + agent skill?

defen 11 hours ago | parent | prev | next [-]

Would this hypothetically be able to download arbitrary videos from youtube without the constant yt-dlp arms race?

dawnerd 11 hours ago | parent | next [-]

Don’t know how this could be more stable than ytdlp. When issues come up they’re fixed really quickly.

varenc 10 hours ago | parent [-]

yt-dlp was very recently broken for ~2 days for any Youtube videos that required cookies: https://github.com/yt-dlp/yt-dlp/issues/16212

Here is what actually fixed it: https://github.com/yt-dlp/ejs/pull/53/changes

yt-dlp is relatively stable, but still occasionally breaks for long periods. I get the sense YouTube is becoming increasingly adversarial to yt-dlp as well.

I don't know the details, but it doesn't seem like yt-dlp is running the entire YouTube JS+DOM environment. Something like a real headless browser seems like it would break less often, but be much heavier weight. And Youtube might have all sorts of other mitigations against this approach.

zipping1549 6 hours ago | parent | next [-]

> const url = (${generate(expression)})("https://youtube.com/watch?v=yt-dlp-wins", "s", sig);

I'm pretty sure yt-dlp is filled with these kinds of gold.

22c 7 hours ago | parent | prev | next [-]

> yt-dlp is running the entire YouTube JS+DOM environment

IIRC they maintain a minimal execution environment that is able to run just the JS needed to pass a few checks but this breaks too often enough that they're planning to make Node.js or another JS interpreter a hard requirement (possibly already happened).

defrost 7 hours ago | parent [-]

Pretty much - yt-dlp currently requires Deno to "solve" youtube challenges.

* https://deno.com/

* there may well be other JS interpreters that are accepted, can be used - but solving JS challenges is required for much, if not all, YT content.

coro_1 7 hours ago | parent | prev | next [-]

> I get the sense YouTube is becoming increasingly adversarial to yt-dlp as well.

I rarely use yt-dlp anymore.

Before I just updated. Now when I do that, it usually becomes complex and full of questions.

toomuchtodo 10 hours ago | parent | prev [-]

I think having a hook to an LLM endpoint to enable yt-dlp to attempt to self resolve until an official fix is available would be a useful enhancement.

dataviz1000 11 hours ago | parent | prev | next [-]

> yt-dlp arms race

I don't know anything about yt-dlp.

It would probably help people who want to go to a concert and have a chance to beat the scalpers cornering the market on an event in 30 seconds hitting the marketplace services with 20,000 requests.

I can try to see if can bypass yt-dlp. But that is always a cat and mouse game.

defen 11 hours ago | parent [-]

To clarify - yt-dlp is a command line tool for downloading youtube videos, but it's in a constant arms race with the youtube website because they are constantly changing things in a way that blocks yt-dlp.

dexterdog 8 hours ago | parent [-]

I wouldn't call it an arms race. I don't update my client that often and I rarely have problems downloading any video with it.

phantomathkg 6 hours ago | parent | prev [-]

If it can save all the video/audio fragment and call ffmpeg to join them together. Maybe?

Johnny_Bonk 11 hours ago | parent | prev | next [-]

Yes, please do and ping me when it's done lol. Did you make it into an agent skill?

dataviz1000 11 hours ago | parent [-]

Exactly, it is an agent skill that interacts pressing buttons and stuff with a webpage capturing and documenting all the API requests the page makes using Playwright's request / response interception methods. It creates and strongly typed well documented API at the end.

bengt 10 hours ago | parent [-]

Sounds awesome. I've been using mitmproxy's --mode local to intercept with a separate skill to read flow files dumped from it, but interactive is even better.

miohtama 9 hours ago | parent | prev | next [-]

I just ask Claude to reverse engineer the site with Chrome MCP. It goes to work by itself, uses your Chrome logged in session cookies, etc.

rkagerer 5 hours ago | parent | prev | next [-]

I assume you're not logged into those sites, in order to avoid bans and the risk of hitting the wrong button like, say, "Delete Account".

dataviz1000 5 hours ago | parent [-]

It turns any authenticated browser session into a fully typed REST API proxy — exposing discovered endpoints as local Hono routes that relay requests through the browser, so cookies and auth are automatic.

The point is that it creates an API proxy in code that a Typescript server calls directly. The AI runs for about 10 minutes with codegen. The rest of the time it is just API calls to a service. Remove the endpoint for "Delete Account" and that API endpoint never gets called.

This 100% breaks everyone's terms of service. I would not recommend nor encourage using.

mikrl 10 hours ago | parent | prev | next [-]

I was doing similar by capturing XHR requests while clicking through manually, then asking codex to reverse engineer the API from the export.

Never tried that level of autonomy though. How long is your iteration cycle?

If I had to guess, mine was maybe 10-20 minutes over a few prompts.

xrd 11 hours ago | parent | prev | next [-]

Yes, please do!

dataviz1000 11 hours ago | parent [-]

100% I'll response to this by Friday with link to Github.

I use Patchright + Ghostery and I have a cleaver tool that uses web sockets to pass 1 second interval screenshots to the a dashboard and pointer / keyboard events to the server which allow interacting with websites so that a user can create authentication that is stored in the chrome user profile with all the cookies, history, local storage, ect.. in the cloud on a server.

Can you list some websites that don't require subscription that you would like to me to test against? I used this for Robinhood and I think Linked in would be a good example for people to use.

zzleeper 11 hours ago | parent [-]

Another +1, it would be incredibly useful to play with this approach! (and fun)

citizenpaul 5 hours ago | parent | prev | next [-]

Id like to see this published as well thx!

fuzzyfizz an hour ago | parent | prev | next [-]

Wow. Yes please.

liamdgray 10 hours ago | parent | prev | next [-]

Please do!

toomuchtodo 10 hours ago | parent | prev | next [-]

Please publish!

heystefan 9 hours ago | parent | prev | next [-]

Commenting to follow up.

retinaros 10 hours ago | parent | prev | next [-]

isnt it what everyone that needs web validation does?

lizhang 10 hours ago | parent | prev [-]

[dead]