Install
openclaw skills install grok-queryQuery Grok AI (grok.com) for real-time information via browser automation. Requires: OpenClaw browser enabled, user pre-logged-in to grok.com, and a Grok acc...
openclaw skills install grok-queryUse Grok AI to fetch real-time information, latest news, and external knowledge that may not be in your training data.
Before using this skill, ensure the following:
openclaw browser status
Activate when the user:
web_search can provide# Check if grok.com is already open
openclaw browser tabs
If a grok.com tab already exists, directly switch to it:
openclaw browser focus <existing-grok-tab-id>
If not, open a new tab:
openclaw browser open https://grok.com
Both return a target id — keep this for all subsequent calls.
openclaw browser snapshot
After taking a snapshot, check for two things before proceeding:
Common obstructions:
If you see any popup or banner in the snapshot:
# Find the close/dismiss button ref from snapshot, then click it
openclaw browser click <close-button-ref>
# Verify it's gone
openclaw browser snapshot
Or try pressing Escape to dismiss overlays:
openclaw browser press Escape
The Grok input box is a contenteditable div (ProseMirror editor) at the bottom of the page. In snapshot output, look for a paragraph element with placeholder text such as "How can I help you today?" (or its localized equivalent).
If you can't find the input box:
# Scroll the input box into view (if you know its ref)
openclaw browser scrollintoview <ref>
# Or re-snapshot to check
openclaw browser snapshot
openclaw browser type <input-ref> "What is the latest news about AI?"
Important: Grok uses Enter for newline, NOT for sending. You must click the send button (the circular ⬆ icon button to the right of the input box).
# After typing, snapshot to find the send button ref
openclaw browser snapshot
# Click the send button — look for the "Submit" button near the input box
openclaw browser click <send-button-ref>
Do NOT use
press Enteror--submit— they only insert a newline in Grok's input box.
While Grok is generating, a "Stop response" button replaces the voice button next to the input box. When it disappears, the response is complete. A "Regenerate" button appearing confirms completion.
Important: Do NOT use wait --text-gone or wait --fn with long timeouts — the browser tool call has a timeout limit and will fail before the wait finishes. Use short waits + snapshot polling instead.
Poll until response is complete:
# 1. Wait 10 seconds
openclaw browser wait --time 10000
# 2. Snapshot and check for completion
openclaw browser snapshot
# Look for "Regenerate" button → response is done
# If "Stop response" button is still visible → still generating, repeat from step 1
Repeat the wait-then-snapshot cycle until you see completion indicators or 5 minutes have elapsed:
Note on localized UI: Button text depends on Grok UI language:
If the snapshot contains img elements in the response area (e.g. from Grok's Imagine feature), extract the image URL:
openclaw browser evaluate --fn "(el) => el.src" --ref <img-ref>
Stay in the same tab to maintain conversation context. Grok understands follow-up questions that reference earlier messages.
# 1. Make sure you're on the correct tab
openclaw browser focus <target-id>
# 2. Snapshot to find the input box (placeholder changes to "Ask anything" in follow-ups)
openclaw browser snapshot
# 3. Type your follow-up question
openclaw browser type <input-ref> "What about tomorrow?"
# 4. Snapshot to find the "Submit" button and click it
openclaw browser snapshot
openclaw browser click <send-button-ref>
# 5. Wait and poll for completion (repeat until "Regenerate" appears)
openclaw browser wait --time 10000
openclaw browser snapshot
Note: The input box and submit button refs change between turns — always snapshot to get fresh refs before typing or clicking.
| Problem | Solution |
|---|---|
| Popup / banner blocking | snapshot, find close button ref, click it; or press Escape |
| Input box not found | press Escape, re-snapshot; or scrollintoview |
| Login required | Ask user to log in to grok.com manually, then openclaw browser navigate https://grok.com |
| Page not loading | openclaw browser navigate https://grok.com or re-open |
| Response incomplete | Increase wait time, take multiple snapshots to confirm |
| Clicked wrong element | Re-snapshot to get fresh refs |
| "Unknown ref" error | The ref is stale — page has changed since last snapshot. Run a new snapshot and use refs from that result. Never reuse refs from a previous snapshot. |
| Free tier quota exceeded | Inform user their Grok quota is used up; wait for reset or upgrade to SuperGrok |
| CAPTCHA / human verification | Cannot be automated; ask user to complete it manually, then retry |
| "Something went wrong" mid-response | Re-send the question or reload the page and try again |
| "Continue generating" button | Click the button to resume generation, then continue polling |
| Session expired / redirected to login | Ask user to re-login in the browser, then reload grok.com |
| Multiple grok.com tabs open | Use tabs to list all, pick the correct one by URL or title |
| DeepSearch UI differs | Completion indicator may differ; poll snapshot and look for source count or result summary instead of "Regenerate" |
| Accidentally opened model selector | press Escape to close the dropdown, then re-snapshot |
| Tab closed or browser killed mid-response | Start over: openclaw browser open https://grok.com and re-send the question |
openclaw browser screenshot if you need visual confirmationFor simpler queries, consider using web_search tool first (faster, no browser needed).
Use Grok when you need: