✓ Verified 🌐 Web Scrapers ✓ Enhanced Data

Grok Browser

Query Grok AI via browser automation.

Rating
5 (137 reviews)
Downloads
1,715 downloads
Version
1.0.0

Overview

Query Grok AI via browser automation.

Complete Documentation

View Source →

Grok Browser Skill

Query Grok (grok.com) via Chrome browser automation and copy responses.

Prerequisites

  • Chrome with Browser Relay extension
  • Use profile=chrome (never profile=clawd)

Quick Start

bash
# 1. Open Chrome with Grok
open -a "Google Chrome" "https://grok.com"
sleep 3

# 2. Attach browser relay
/Users/eason/clawd/scripts/attach-browser-relay.sh

# 3. Check tabs
browser action=tabs profile=chrome

Input Method (IMPORTANT!)

Grok uses contenteditable, not a standard textbox. Use JavaScript evaluate:

javascript
// Type query via evaluate
browser action=act profile=chrome targetId=<id> request={
  "kind": "evaluate",
  "fn": "(() => { const editor = document.querySelector('[contenteditable=\"true\"]'); if(editor) { editor.focus(); editor.innerText = 'YOUR_QUERY_HERE'; return 'typed'; } return 'not found'; })()"
}

Then submit with Enter:

text
browser action=act profile=chrome targetId=<id> request={"kind":"press","key":"Enter"}

Complete Workflow

1. Open Grok & Attach Relay

bash
open -a "Google Chrome" "https://grok.com"
sleep 3
/Users/eason/clawd/scripts/attach-browser-relay.sh

2. Get Tab ID

text
browser action=tabs profile=chrome

Look for Grok tab, note the targetId.

3. Input Query

text
browser action=act profile=chrome targetId=<id> request={
  "kind": "evaluate",
  "fn": "(() => { const e = document.querySelector('[contenteditable=\"true\"]'); if(e) { e.focus(); e.innerText = 'What is quantum computing?'; return 'ok'; } return 'fail'; })()"
}

4. Submit

text
browser action=act profile=chrome targetId=<id> request={"kind":"press","key":"Enter"}

5. Wait for Response

bash
sleep 10-20  # Grok can take 10-30 seconds

6. Snapshot & Find Copy Button

text
browser action=snapshot profile=chrome targetId=<id>

Look for button with "Copy" in the response area (usually last message).

7. Click Copy

text
browser action=act profile=chrome targetId=<id> request={"kind":"click","ref":"<copy_button_ref>"}

8. Read Clipboard

bash
pbpaste

Response Detection

After submitting, response is complete when:

  • Copy button appears below the response text
  • Response time indicator shows (e.g., "952ms")
  • Suggested follow-up buttons appear

New Chat for New Topics

Always start fresh chats for unrelated queries to avoid context overflow:

text
browser action=navigate profile=chrome targetId=<id> targetUrl="https://grok.com"

Or use Cmd+J shortcut:

text
browser action=act profile=chrome targetId=<id> request={"kind":"press","key":"Meta+j"}

DeepSearch

To enable DeepSearch, click the button before submitting:

text
# In snapshot, find DeepSearch button
browser action=act profile=chrome targetId=<id> request={"kind":"click","ref":"<deepsearch_ref>"}
# Then type and submit as normal

Troubleshooting

Tab Not Found

Re-run attach script:
bash
/Users/eason/clawd/scripts/attach-browser-relay.sh

Relay Not Working

Check status:
text
browser action=status profile=chrome
Should show cdpReady: true.

Context Overflow

Navigate to fresh grok.com, don't continue old chats.

Multiple Windows

Close extra Chrome windows. Keep only one for reliable relay.

Copy Button Not Found

Response may still be streaming. Wait longer and snapshot again.

Example Session

text
# Open and attach
exec: open -a "Google Chrome" "https://grok.com"
exec: sleep 3
exec: /Users/eason/clawd/scripts/attach-browser-relay.sh

# Get tab
browser action=tabs profile=chrome
# Returns targetId: ABC123...

# Type query
browser action=act profile=chrome targetId=ABC123 request={
  "kind":"evaluate",
  "fn":"(() => { const e = document.querySelector('[contenteditable=\"true\"]'); e.focus(); e.innerText = 'Explain quantum entanglement briefly'; return 'ok'; })()"
}

# Submit
browser action=act profile=chrome targetId=ABC123 request={"kind":"press","key":"Enter"}

# Wait
exec: sleep 15

# Snapshot to find Copy button
browser action=snapshot profile=chrome targetId=ABC123
# Find Copy button ref, e.g., e326

# Copy
browser action=act profile=chrome targetId=ABC123 request={"kind":"click","ref":"e326"}

# Read result
exec: pbpaste

Installation

Terminal bash

openclaw install grok-browser
    
Copied!

💻Code Examples

browser action=tabs profile=chrome

browser-actiontabs-profilechrome.txt
## Input Method (IMPORTANT!)

Grok uses **contenteditable**, not a standard textbox. Use JavaScript evaluate:

browser action=act profile=chrome targetId=<id> request={"kind":"press","key":"Enter"}

browser-actionact-profilechrome-targetidid-requestkindpresskeyenter.txt
## Complete Workflow

### 1. Open Grok & Attach Relay

browser action=tabs profile=chrome

browser-actiontabs-profilechrome.txt
Look for Grok tab, note the `targetId`.

### 3. Input Query

browser action=snapshot profile=chrome targetId=<id>

browser-actionsnapshot-profilechrome-targetidid.txt
Look for button with "Copy" in the response area (usually last message).

### 7. Click Copy

pbpaste

pbpaste.txt
## Response Detection

After submitting, response is complete when:
- Copy button appears below the response text
- Response time indicator shows (e.g., "952ms")
- Suggested follow-up buttons appear

## New Chat for New Topics

Always start fresh chats for unrelated queries to avoid context overflow:

browser action=act profile=chrome targetId=<id> request={"kind":"press","key":"Meta+j"}

browser-actionact-profilechrome-targetidid-requestkindpresskeymetaj.txt
## DeepSearch

To enable DeepSearch, click the button before submitting:

# Then type and submit as normal

-then-type-and-submit-as-normal.txt
## Troubleshooting

### Tab Not Found
Re-run attach script:

/Users/eason/clawd/scripts/attach-browser-relay.sh

userseasonclawdscriptsattach-browser-relaysh.txt
### Relay Not Working
Check status:

browser action=status profile=chrome

browser-actionstatus-profilechrome.txt
Should show `cdpReady: true`.

### Context Overflow
Navigate to fresh grok.com, don't continue old chats.

### Multiple Windows
Close extra Chrome windows. Keep only one for reliable relay.

### Copy Button Not Found
Response may still be streaming. Wait longer and snapshot again.

## Example Session
example.sh
# 1. Open Chrome with Grok
open -a "Google Chrome" "https://grok.com"
sleep 3

# 2. Attach browser relay
/Users/eason/clawd/scripts/attach-browser-relay.sh

# 3. Check tabs
browser action=tabs profile=chrome

Tags

#browser_and-automation #automation

Quick Info

Category Web Scrapers
Model Claude 3.5
Complexity Multi-Agent
Author easonc13
Last Updated 3/10/2026
🚀
Optimized for
Claude 3.5
🧠

Ready to Install?

Get started with this skill in seconds

openclaw install grok-browser