DEV Community

Henry Knight
Henry Knight

Posted on

How I Built a Claude Browser Agent That Works 24/7 (No Code Required)

Six months ago I was doing something embarrassing.

Every morning, I would wake up, open my laptop, and manually check five different sites for leads. Copy URLs into a spreadsheet. Check if certain pages had changed. Scrape a list of emails. It took about 90 minutes every single day, seven days a week, and I had built an entire morning routine around this manual busywork.

Then one afternoon I thought: Claude can write code. What if I just asked it to do this for me?

I had zero background in browser automation. No Selenium experience. Never touched Playwright. But I had Claude and a weekend.

That weekend changed how I work.


What I Actually Built

The core idea sounds deceptively simple: a Claude-powered agent that controls a real browser, navigates websites, extracts data, and saves it to a database -- on a schedule, automatically, while I am asleep.

Here is what it does for me now:

  • Monitors 3 lead sources at 6am every morning
  • Scrapes contact info and writes it directly to a SQLite database
  • Checks a competitor pricing page daily and sends me an alert if it changes
  • Fills out repetitive web forms (the kind that used to eat 30 minutes of my afternoon)
  • Logs into platforms with saved sessions -- no CAPTCHA fighting, no manual re-auth

The whole stack runs on my local machine. No cloud servers. No monthly SaaS bill. No API fees beyond whatever Claude tokens it uses (usually pennies per run).


The "No Code" Part -- What That Actually Means

I want to be honest about this because the phrase "no code" gets abused.

What I mean is: you do not need to write the browser automation code. Claude writes it for you.

The workflow is:

  1. You describe the task in plain English: "Go to this URL, find the price listed under the Pro Plan heading, and save it to a file."
  2. Claude generates the Playwright or CDP automation script.
  3. The agent runs it.
  4. If it fails (page changed, element moved, site added a CAPTCHA), Claude reads the error and adjusts.

That last part -- the self-correction loop -- is what makes it feel like magic. Traditional browser scripts are brittle. They break every time a site changes. This agent notices when something breaks and figures out a different approach.

You are not writing code. You are writing instructions. And correcting the agent when it goes sideways (which is much easier than debugging JavaScript).


The Part Nobody Talks About: Dealing With Anti-Bot Systems

I ran into this wall hard about two weeks in.

Some sites -- especially the ones with the most useful leads -- have PerimeterX or Cloudflare protection. The browser agent would get blocked silently: no error, just a blank page or a CAPTCHA loop.

The fix I landed on was a combination of:

  • Real residential IPs (I use a rotating proxy service, around 2 dollars per GB) rather than datacenter IPs
  • Actual Chrome via Chrome DevTools Protocol (CDP), not a headless browser -- sites can detect headless flags
  • Human-like timing: small random delays between actions, realistic scroll behavior
  • Session persistence: staying logged in rather than re-authenticating every run

None of this is complicated once you know it is needed. But nobody is writing about it clearly. Most tutorials skip straight to the happy path and leave you wondering why your script gets blocked on the sites that matter.


What the 24/7 Piece Looks Like

The scheduling is the unsexy part that makes everything work.

On Mac, I use launchd -- the macOS built-in task scheduler. I have a plist file that triggers my agent script every morning at 6:00 AM before I wake up. No cron, no Docker, no VPS. Just a 20-line XML file and the script runs forever.

The agent:

  1. Reads a task list from a SQLite database
  2. Runs each task in sequence
  3. Logs results back to the database
  4. Sends me a summary (I use Telegram for this)

I wake up to a message: "Morning run complete. 47 new leads found. 2 tasks failed -- rate limited on Site B, retry scheduled for 9am."

That is it. That is the whole thing.


Results After 6 Months

Real numbers, not vibes:

  • Time saved: roughly 85 minutes per day, about 515 hours per year
  • Leads processed: around 1,400 per month on autopilot
  • Cost: About 30 cents per day in Claude tokens, plus proxy costs when scraping protected sites
  • Times it broke: Probably 40-50 times (sites change). Average fix time: 8 minutes.

The breaks are the thing I did not expect. You have to maintain this like a garden. But 8 minutes to fix a broken scraper vs. 90 minutes of manual work every single day? I will take that trade every time.


What You Would Need to Replicate This

The core pieces:

  1. Claude API access -- Sonnet is plenty for most tasks; Opus for complex reasoning
  2. Chrome + CDP setup -- lets Claude control a real browser session
  3. A task runner -- something to schedule and coordinate the agent runs
  4. SQLite -- dead simple local storage, no database server needed
  5. A proxy service -- optional, but required if you are hitting protected sites

The learning curve is steeper than I would like to admit. It took me two weeks of evenings to get the first version working reliably. Most of that time was spent on things no tutorial covered: session handling, CAPTCHA strategies, building the retry logic.


Skip the Two Weeks

I packaged everything I learned into a starter kit: the exact directory structure, the Chrome CDP setup, the task runner, the scheduling config, and the SQLite schema I use.

It is the thing I wish existed when I started.

Get the full starter kit: knightops.gumroad.com/l/claude-browser-agent-starter-kit -- 7 dollars, or pay what you want.

If you are not sure it is for you, the page has a full breakdown of what is included. No fluff, no course -- just the working files.


Questions? Drop them in the comments. I check in every few days and answer everything.

Top comments (0)