Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问clear审计异常

gemini-research-browser-useGemini 研究浏览器 USE

Agent Skill

gemini-research-browser-use 用于处理浏览器自动化、网页检查和页面信息提取,适合在 Codex、Claude、Cursor、Gemini CLI 中需要让 Agent 打开页面、读取网页或验证前端流程时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,697

周安装

68

GitHub Stars

3

下载量

549
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:gemini-research-browser-use(Gemini 研究浏览器 USE)
来源仓库:https://github.com/grasseed/google-search-browser-use
仓库路径:skills/gemini-research-browser-use
安装命令:
npx skills add https://github.com/grasseed/google-search-browser-use --skill gemini-research-browser-use
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/grasseed/google-search-browser-use --skill gemini-research-browser-use

简介

用于处理浏览器自动化和网页信息提取。gemini-research-browser-use 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

  • 适合让 Agent 打开页面、读取内容或验证前端流程。
  • 通过 GitHub 安装,建议确认页面访问权限和操作范围。
  • 可能触发网络请求和 DOM 操作,需注意性能和安全。
  • 适用于 Codex、Claude、Cursor 和 Gemini CLI 网页研究。

SKILL.md

Gemini Research Browser Use

Overview

Perform research or queries using Google Gemini via Chrome DevTools Protocol (CDP). This method reuses the user's existing Chrome login session to interact with the Gemini web interface (https://gemini.google.com/).

Prerequisites

  1. Python + websockets Verify: python3 --version python3 -m pip show websockets Install if missing: python3 -m pip install websockets
  2. Google Chrome Verify: "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --version
  3. CDP Port Availability Verify Chrome is listening (after launch in Step 2): curl -s http://localhost:9222/json | python3 -m json.tool
  4. Non-default user data directory (required by Chrome) Chrome CDP requires a non-default profile path. Use a cloned profile so you keep login state. rm -rf /tmp/chrome-gemini-profile rsync -a "$HOME/Library/Application Support/Google/Chrome/" /tmp/chrome-gemini-profile/

Method Comparison

MethodProsConsRecommended
Chrome Remote Debugging (CDP)Uses existing login, full automation, reliableRequires Chrome restart with debugging flagYes
browser-use --browser realSimple CLIOpens new session without login❌ No
browser_subagentVisual feedbackRate limited, may fail❌ No

✅ Recommended Method: Chrome Remote Debugging (CDP)

This is the most reliable method that uses your system Chrome with existing Google login.

Prerequisites

  1. Python 3 with websockets library
  2. Google Chrome installed at /Applications/Google Chrome.app/
  3. User logged into Google in Chrome

Step 1: Install websockets (if needed)

pip3 install websockets
# Or in virtual environment:
python3 -m venv .venv && ./.venv/bin/pip install websockets

Step 2: Launch Chrome with Remote Debugging (Non-default profile)

Important: Close any existing Chrome windows first, or use a different debugging port.

"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
  --remote-debugging-port=9222 \
  --user-data-dir="/tmp/chrome-gemini-profile" \
  "https://gemini.google.com/" &

Parameters explained:

  • --remote-debugging-port=9222: Enables CDP on port 9222
  • --user-data-dir: Points to your existing Chrome profile (with login session)
  • The URL opens Gemini directly

Step 3: Verify Connection (CDP)

curl -s http://localhost:9222/json | python3 -m json.tool

Look for the Gemini page entry:

{
  "title": "Google Gemini",
  "url": "https://gemini.google.com/app",
  "webSocketDebuggerUrl": "ws://localhost:9222/devtools/page/XXXXXXXX"
}

Note: If URL shows /app instead of just /, it means you're logged in.

Step 4: Send Query to Gemini

Save this as gemini_query.py or run inline:

import asyncio
import websockets
import json
import subprocess
import sys

async def query_gemini(query_text, wait_seconds=30):
    # Get the Gemini page WebSocket URL
    result = subprocess.run(
        ["curl", "-s", "http://localhost:9222/json"],
        capture_output=True, text=True
    )
    pages = json.loads(result.stdout)

    # Find Gemini page
    gemini_page = None
    for page in pages:
        if page.get("type") == "page" and "gemini.google.com" in page.get("url", ""):
            gemini_page = page
            break

    if not gemini_page:
        print("Error: Gemini page not found. Make sure Chrome is open with Gemini.")
        return None

    ws_url = gemini_page["webSocketDebuggerUrl"]
    print(f"Connecting to: {ws_url}")

    async with websockets.connect(ws_url) as ws:
        # Step 1: Input the query
        input_js = f'''
        const editor = document.querySelector('div[contenteditable="true"]');
        if(editor) {{
            editor.focus();
            document.execCommand('insertText', false, `{query_text}`);
            editor.dispatchEvent(new Event('input', {{bubbles: true}}));
            'success';
        }} else {{
            'editor not found';
        }}
        '''

        await ws.send(json.dumps({
            "id": 1,
            "method": "Runtime.evaluate",
            "params": {"expression": input_js}
        }))
        response = await ws.recv()
        result = json.loads(response)
        print(f"Input result: {result.get('result', {}).get('result', {}).get('value', 'unknown')}")

        # Step 2: Click send button
        await asyncio.sleep(1)
        click_js = '''
        const btn = document.querySelector('button[aria-label="傳送訊息"]');
        if(btn) { btn.click(); 'clicked'; } else { 'button not found'; }
        '''

        await ws.send(json.dumps({
            "id": 2,
            "method": "Runtime.evaluate",
            "params": {"expression": click_js}
        }))
        response = await ws.recv()
        result = json.loads(response)
        print(f"Click result: {result.get('result', {}).get('result', {}).get('value', 'unknown')}")

        # Step 3: Wait for response
        print(f"Waiting {wait_seconds} seconds for Gemini to respond...")
        await asyncio.sleep(wait_seconds)

        # Step 4: Extract the response
        extract_js = '''
        const markdownEls = document.querySelectorAll('.markdown');
        if(markdownEls.length > 0) {
            markdownEls[markdownEls.length - 1].innerText;
        } else {
            'No response found';
        }
        '''

        await ws.send(json.dumps({
            "id": 3,
            "method": "Runtime.evaluate",
            "params": {"expression": extract_js}
        }))
        response = await ws.recv()
        result = json.loads(response)
        content = result.get('result', {}).get('result', {}).get('value', 'No content')

        return content

# Main execution
if __name__ == "__main__":
    query = sys.argv[1] if len(sys.argv) > 1 else "範例問題:請用繁體中文回答什麼是區塊鏈?"
    result = asyncio.run(query_gemini(query, wait_seconds=30))
    print("\n" + "="*50)
    print("GEMINI RESPONSE:")
    print("="*50)
    print(result)

Step 5: Run the Query

python3 gemini_query.py "範例問題:你的查詢問題"

Or inline for simple queries:

python3 << 'EOF'
import asyncio
import websockets
import json

async def send_to_gemini():
    # Get WebSocket URL
    import subprocess
    result = subprocess.run(["curl", "-s", "http://localhost:9222/json"], capture_output=True, text=True)
    pages = json.loads(result.stdout)
    ws_url = next(p["webSocketDebuggerUrl"] for p in pages if "gemini.google.com" in p.get("url", ""))

    async with websockets.connect(ws_url) as ws:
        # Input query
        await ws.send(json.dumps({
            "id": 1,
            "method": "Runtime.evaluate",
            "params": {"expression": '''
                const editor = document.querySelector('div[contenteditable="true"]');
                editor.focus();
                document.execCommand('insertText', false, '範例問題:請分析比特幣未來的價格走勢');
                editor.dispatchEvent(new Event('input', {bubbles: true}));
            '''}
        }))
        await ws.recv()

        # Click send
        await asyncio.sleep(1)
        await ws.send(json.dumps({
            "id": 2,
            "method": "Runtime.evaluate",
            "params": {"expression": '''document.querySelector('button[aria-label="傳送訊息"]').click()'''}
        }))
        await ws.recv()

        # Wait and extract
        await asyncio.sleep(30)
        await ws.send(json.dumps({
            "id": 3,
            "method": "Runtime.evaluate",
            "params": {"expression": '''
                document.querySelectorAll('.markdown')[document.querySelectorAll('.markdown').length - 1].innerText
            '''}
        }))
        response = await ws.recv()
        print(json.loads(response)['result']['result']['value'])

asyncio.run(send_to_gemini())
EOF

Alternative Method: browser-use CLI

This method is simpler but does not use your existing Chrome login. You'll need to log in manually each time.

Prerequisites

# Create virtual environment
python3 -m venv .venv

# Install browser-use
./.venv/bin/pip install browser-use

Workflow

1) Open Gemini

./.venv/bin/browser-use --browser real open "https://gemini.google.com/"

2) Get Page State

./.venv/bin/browser-use --browser real state

Look for:

  • The input textbox: contenteditable=true role=textbox
  • The send button: aria-label=傳送訊息

3) Input Text via JavaScript eval

./.venv/bin/browser-use --browser real eval "const editor = document.querySelector('div[contenteditable=\"true\"]'); editor.focus(); document.execCommand('insertText', false, 'YOUR QUERY HERE'); editor.dispatchEvent(new Event('input', {bubbles: true}));"

4) Click Send Button

# Get current state to find button index
./.venv/bin/browser-use --browser real state

# Click the send button (replace INDEX with actual number)
./.venv/bin/browser-use --browser real click INDEX

5) Close Session

./.venv/bin/browser-use close

Troubleshooting

Chrome Remote Debugging Issues

ProblemCauseSolution
curl: (7) Failed to connectChrome not running with debuggingRestart Chrome with --remote-debugging-port=9222
WebSocket connection refusedPage ID changedRe-fetch /json to get new WebSocket URL
"editor not found"Page not fully loadedWait a few seconds before running script
"button not found"Send button not visibleCheck if text was actually input first
Login page instead of appWrong user-data-dir pathVerify path: "$HOME/Library/Application Support/Google/Chrome"
DevTools remote debugging requires a non-default data directoryChrome disallows default profile for CDPLaunch with a cloned profile: /tmp/chrome-gemini-profile
curl shows connection refused even though Chrome is runningCDP not listening due to profile pathEnsure --user-data-dir is not default and the port is free
No Gemini page found via CDPGemini not loaded or not logged inOpen https://gemini.google.com/ in the launched Chrome and wait for /app

browser-use Issues

ProblemCauseSolution
Not logged inbrowser-use creates isolated sessionUse Chrome Remote Debugging method instead
Unknown key: "請" errorCLI doesn't support UnicodeUse eval with JavaScript execCommand
Click doesn't workElement index changedRe-run state before each click

Best Practices

  1. Always use Chrome Remote Debugging for queries requiring authentication
  2. Wait 30+ seconds for complex queries (Gemini's "Deep Think" mode takes longer)
  3. Check for .markdown elements to verify response is complete
  4. Use inline Python for one-off queries; use the full script for automation
  5. Close Chrome debugging session when done to avoid port conflicts
  6. Keep profile cloned in /tmp/chrome-gemini-profile to avoid CDP blocking the default profile

Complete Example: Crypto Price Analysis

完整工作流程

# Step 1: 準備 Chrome 設定檔副本 (避免 CDP 預設目錄限制)
rm -rf /tmp/chrome-gemini-profile
rsync -a "$HOME/Library/Application Support/Google/Chrome/" /tmp/chrome-gemini-profile/

# Step 2: 啟動 Chrome 遠端除錯模式
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
  --remote-debugging-port=9222 \
  --user-data-dir="/tmp/chrome-gemini-profile" \
  "https://gemini.google.com/" > /dev/null 2>&1 &

# Step 3: 等待頁面載入並驗證連接
sleep 8
curl -s http://localhost:9222/json | python3 -c "import sys, json; pages = json.load(sys.stdin); gemini = [p for p in pages if p.get('type') == 'page' and 'gemini.google.com' in p.get('url', '')]; print(f\"找到 Gemini 頁面: {gemini[0]['url'] if gemini else '未找到'}\")"

方法 1: 完整查詢腳本 (query_gemini.py)

將以下內容儲存為 query_gemini.py:

import asyncio
import websockets
import json
import subprocess
import sys

async def query_gemini(query_text, wait_seconds=60):
    # Get the Gemini page WebSocket URL
    result = subprocess.run(
        ["curl", "-s", "http://localhost:9222/json"],
        capture_output=True, text=True
    )
    pages = json.loads(result.stdout)

    # Find Gemini page
    gemini_page = None
    for page in pages:
        if page.get("type") == "page" and "gemini.google.com" in page.get("url", ""):
            gemini_page = page
            break

    if not gemini_page:
        print("錯誤:找不到 Gemini 頁面。請確保 Chrome 已開啟 Gemini。")
        return None

    ws_url = gemini_page["webSocketDebuggerUrl"]
    print(f"正在連接到: {ws_url}")

    async with websockets.connect(ws_url) as ws:
        # Step 1: Input the query
        input_js = f'''
        const editor = document.querySelector('div[contenteditable="true"]');
        if(editor) {{
            editor.focus();
            document.execCommand('insertText', false, `{query_text}`);
            editor.dispatchEvent(new Event('input', {{bubbles: true}}));
            'success';
        }} else {{
            'editor not found';
        }}
        '''

        await ws.send(json.dumps({
            "id": 1,
            "method": "Runtime.evaluate",
            "params": {"expression": input_js}
        }))
        response = await ws.recv()
        result = json.loads(response)
        print(f"輸入結果: {result.get('result', {}).get('result', {}).get('value', 'unknown')}")

        # Step 2: Click send button
        await asyncio.sleep(1)
        click_js = '''
        const btn = document.querySelector('button[aria-label="傳送訊息"]');
        if(btn) { btn.click(); 'clicked'; } else { 'button not found'; }
        '''

        await ws.send(json.dumps({
            "id": 2,
            "method": "Runtime.evaluate",
            "params": {"expression": click_js}
        }))
        response = await ws.recv()
        result = json.loads(response)
        print(f"點擊結果: {result.get('result', {}).get('result', {}).get('value', 'unknown')}")

        # Step 3: Wait for response
        print(f"等待 {wait_seconds} 秒讓 Gemini 回應...")
        await asyncio.sleep(wait_seconds)

        # Step 4: Extract the response - try to get complete content
        extract_js = '''
        const markdownEls = document.querySelectorAll('.markdown');
        if(markdownEls.length > 0) {
            const lastMarkdown = markdownEls[markdownEls.length - 1];
            // Get all text content including nested elements
            lastMarkdown.innerText || lastMarkdown.textContent || 'Empty response';
        } else {
            'No response found';
        }
        '''

        await ws.send(json.dumps({
            "id": 3,
            "method": "Runtime.evaluate",
            "params": {"expression": extract_js}
        }))
        response = await ws.recv()
        result = json.loads(response)
        content = result.get('result', {}).get('result', {}).get('value', 'No content')

        return content

# Main execution
if __name__ == "__main__":
    query = """範例問題:請詳細分析 BTC、ETH 的價格預測走勢。
需包含相關專業指標,並用繁體中文回答。"""

    result = asyncio.run(query_gemini(query, wait_seconds=60))
    print("\n" + "="*50)
    print("GEMINI 回應:")
    print("="*50)
    print(result)

執行方式:

python3 query_gemini.py

方法 2: 獲取已存在的回應 (get_gemini_response.py)

如果 Gemini 頁面已經有回應,可以使用此腳本直接提取:

import asyncio
import websockets
import json
import subprocess

async def get_all_gemini_content():
    # Get the Gemini page WebSocket URL
    result = subprocess.run(
        ["curl", "-s", "http://localhost:9222/json"],
        capture_output=True, text=True
    )
    pages = json.loads(result.stdout)

    # Find Gemini page
    gemini_page = None
    for page in pages:
        if page.get("type") == "page" and "gemini.google.com" in page.get("url", ""):
            gemini_page = page
            break

    if not gemini_page:
        print("錯誤:找不到 Gemini 頁面。")
        return None

    ws_url = gemini_page["webSocketDebuggerUrl"]
    print(f"正在連接到: {ws_url}\n")

    async with websockets.connect(ws_url) as ws:
        # Extract all markdown content from the page
        extract_js = '''
        (function() {
            const markdownEls = document.querySelectorAll('.markdown');
            console.log('Found markdown elements:', markdownEls.length);

            if(markdownEls.length === 0) {
                return 'No markdown elements found';
            }

            // Get the last two markdown elements (user query and AI response)
            const responses = [];
            const startIdx = Math.max(0, markdownEls.length - 2);

            for(let i = startIdx; i < markdownEls.length; i++) {
                const text = markdownEls[i].innerText || markdownEls[i].textContent || '';
                if(text.trim()) {
                    responses.push(`[回應 ${i+1}]:\\n${text}`);
                }
            }

            return responses.join('\\n\\n' + '='.repeat(80) + '\\n\\n');
        })()
        '''

        await ws.send(json.dumps({
            "id": 1,
            "method": "Runtime.evaluate",
            "params": {"expression": extract_js, "returnByValue": True}
        }))
        response = await ws.recv()
        result = json.loads(response)
        content = result.get('result', {}).get('result', {}).get('value', 'No content')

        return content

# Main execution
if __name__ == "__main__":
    result = asyncio.run(get_all_gemini_content())
    print("="*80)
    print("GEMINI 對話內容:")
    print("="*80)
    print(result)

執行方式:

python3 get_gemini_response.py

實際使用範例

# 完整流程
rm -rf /tmp/chrome-gemini-profile && \
rsync -a "$HOME/Library/Application Support/Google/Chrome/" /tmp/chrome-gemini-profile/ && \
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
  --remote-debugging-port=9222 \
  --user-data-dir="/tmp/chrome-gemini-profile" \
  "https://gemini.google.com/" > /dev/null 2>&1 &

# 等待並執行查詢
sleep 8 && python3 query_gemini.py

清理資源

完成查詢後,建議清理臨時文件和資源:

# 1. 關閉 Chrome 除錯會話
pkill -9 "Google Chrome"

# 2. 清理臨時設定檔 (可選,釋放磁碟空間)
rm -rf /tmp/chrome-gemini-profile

# 3. 清理測試過程中生成的臨時腳本和輸出文件
rm -f query_gemini.py get_gemini_response.py get_all_gemini_content.py
rm -f gemini_response.txt gemini_full_response.txt

最佳實踐:

  1. 每次使用後關閉 Chrome - 避免佔用 9222 端口
  2. 定期清理臨時設定檔 - /tmp/chrome-gemini-profile 可能佔用數百 MB
  3. 保持工作目錄整潔 - 刪除測試腳本,將常用腳本整合到專案中
  4. 使用完整腳本 - 將上述 query_gemini.py 儲存為專案文件,而非每次重新建立

注意事項

  1. 等待時間調整 - 複雜查詢(如深度分析)建議 wait_seconds=60 或更長
  2. 回應截斷問題 - 如果回應很長,可能需要多次提取或使用 get_all_gemini_content.py 方法
  3. 登入狀態 - 確保 Chrome 設定檔中已登入 Google 帳號
  4. 網路穩定性 - CDP 連接需要穩定的網路環境
  5. 並發限制 - 避免同時開啟多個 Chrome 除錯會話在同一端口

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Antigravity

29.83%
按下载量换算164

Gemini CLI

24.73%
按下载量换算136

Codex

17.45%
按下载量换算96

windsurf

11.45%
按下载量换算63

Claude Code

8.51%
按下载量换算47

Cursor

3.37%
按下载量换算19

安全审计

Gen Agent Trust Hub

未通过

Socket

未通过

Snyk

未通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills