Skip to main content

grok-query-scrape

Submit prompts to https://grok.com using an authenticated cookie file and capture the generated answer verbatim. Use when the task requires raw prompt passthrough, raw Grok output capture, and reproducible artifacts without JSON parsing.

소스 정보

저장소
yang0/skill_grok
최근 소스 활동
2026년 2월 28일 08:06
감지된 SKILL.md 언어
영어
스타
0
포크
0

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
5 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
grok-query-scrape
description
Submit prompts to https://grok.com using an authenticated cookie file and capture the generated answer verbatim. Use when the task requires raw prompt passthrough, raw Grok output capture, and reproducible artifacts without JSON parsing.
# Grok Query Scrape Use this skill to run a repeatable Grok automation workflow: - Load Netscape-format cookies (for logged-in session reuse) - Open Grok in a browser session - Submit the prompt exactly as provided - Wait for answer generation to stabilize - Return and save raw output only (no parsing) Language guides: - Chinese guide: [references/usage_zh.md](references/usage_zh.md) - English guide: [references/usage_en.md](references/usage_en.md) ## Workflow 1. Install runtime dependencies when missing: ```powershell pip install patchright ``` 2. Prepare a cookie file in Netscape format (example: `H:\cookies\grok.txt`). 3. Run the script: ```powershell python E:\projectHome\skill_grok\skill\grok-query-scrape\scripts\query_grok.py ` --cookie-file H:\cookies\grok.txt ` --prompt "Find top 10 AI productivity tweets from the last 24 hours." ` --output-dir E:\ ` --basename grok_ai_top10 ` --wait-seconds 240 ``` 4. Check outputs: - `<stdout>`: Grok response text (verbatim capture from `main`) - `<basename>_raw.txt`: same raw Grok response text saved to file - `<basename>_meta.json`: run metadata and paths ## Script Use [query_grok.py](scripts/query_grok.py) for execution. Key flags: - `--cookie-file`: Netscape cookie txt path (required) - `--prompt`: inline prompt - `--prompt-file`: prompt text file (alternative to `--prompt`) - `--output-dir`: output folder (default `.`) - `--basename`: output filename prefix (default `grok_result`) - `--wait-seconds`: max wait for response stabilization (default `180`) - `--headless`: run browser headless - `--new-chat`: send `Ctrl+J` before query to reduce contamination (enabled by default) ## Prompting Guidance This skill forwards the prompt as-is, so put all constraints directly into your prompt text. ## Failure Handling If the output format is not what you need: 1. Keep `_raw.txt` as ground truth. 2. Tighten the prompt and retry. 3. Keep `--new-chat` enabled for isolation. 4. Increase `--wait-seconds` when generation is long. If login fails: 1. Refresh cookie file from a valid browser session. 2. Keep domain/path/secure flags intact in Netscape format. 3. Retry with `--headless` disabled to inspect behavior. ### scripts/ - [query_grok.py](scripts/query_grok.py): submit prompt, wait for answer, return/save raw/meta only.
GitHub에서 보기