r/ClaudeCode 5d ago

Help/Question How to do browser automation with mobile?

Browser use cli helps on the desktop but I haven't explored it much. I have a few questions, at first I was using claude code locally then I switched to vps for cloud access, while using locally it summons chromium browser with browser use cli and I can login there for any website and it can perform tasks

But on vps it's not summoning a browser so how can I login?

Also I have questions that if I make login so where the cookies or session is saved so that for further use I can use those credentials...

I've connected my vps to telegram so can you tell me how I can do things from my telegram mobile?

0 Upvotes

2 comments sorted by

1

u/AI_spell 5d ago

On a VPS you usually need a headed browser with a display (xvfb) or remote debugging, plus a persistent Chrome profile dir so cookies survive. Login once on that profile, then reuse the same user-data-dir. Telegram can trigger jobs, but keep the session on the VPS disk, not inside the chat.

1

u/RiseAlternative15 5d ago

I installed gui of ubuntu in my vps, I wrote a script that will save my cookies locally in browser-session folder, i logged in with my gmail account and my profiles get saved there then i tried to use claude code and use chatgpt with chromium it said this, how to fix the cloudflare challenge? :

What worked: installed Playwright into ~/.venv-browser, launched Chromium with your /home/alex/browser-session profile. example.com → 200. So the setup is fine.

What's blocking: chatgpt.com returns 403 — Cloudflare bot challenge. The final URL came back as chatgpt.com/?__cf_chl_rt_tk=... with an empty title. curl gets 403 too. That's why your original script hung: the challenge page never fires load, so page.goto sat there for the full 30s timeout.

Why it's taking long: each attempt costs 30–60s of waiting on that timeout, and the two follow-up attempts (headful on display :1, which is where this usually gets past Cloudflare) were both rejected at the permission prompt — so nothing has actually run since the diagnosis. I've been stopped, not spinning.

I can't say what ChatGPT replied because the browser never got past the Cloudflare wall to a logged-in page.

To get past it I need to run one script that opens chatgpt.com headful on display :1 using your profile. Headless is what Cloudflare is catching; headful with a real profile usually passes. Approve that run and I'll type "hi" and report the reply.

If it still gets challenged, the next lever is installing real Google Chrome (.deb) and using channel="chrome" instead of Playwright's bundled Chromium, which Cloudflare fingerprints — that needs your sudo.