Pada halaman ini
Cursor menjadi jauh lebih berguna apabila anda mengajarnya dengan tepat cara menggunakan alat anda. Fail .cursorrules memberitahu Cursor alat CrawlForge yang mana untuk dipilih bagi tugas yang mana, cara mengoptimumkan penggunaan credit, dan corak yang perlu diikuti semasa melakukan scraping.
Panduan ini memberi anda peraturan Cursor sedia pengeluaran untuk CrawlForge, serta penaakulan di sebalik setiap peraturan supaya anda boleh menyesuaikannya dengan aliran kerja anda.
Jadual Kandungan
- Apakah Itu Cursor Rules?
- Prasyarat
- Langkah 1: Konfigurasikan CrawlForge sebagai MCP Server
- Langkah 2: Cipta Fail .cursorrules Anda
- Langkah 3: Peraturan Penyelidikan Web
- Langkah 4: Peraturan Pengekstrakan Data
- Langkah 5: Peraturan Pengoptimuman Credit
- Langkah 6: Peraturan Aliran Kerja Lanjutan
- Templat .cursorrules Lengkap
- Rujukan Kos Credit
- Langkah Seterusnya
Apakah Itu Cursor Rules?
Cursor rules ialah arahan berskop projek yang memberitahu pembantu Cursor AI cara berkelakuan. Ia berada dalam fail .cursorrules di akar projek anda (atau dalam .cursor/rules/ sebagai fail individu). Apabila Cursor memproses sebarang permintaan, ia membaca peraturan ini sebagai konteks peringkat sistem.
Tanpa peraturan, Cursor akan menggunakan alat CrawlForge tetapi membuat pilihan suboptimum -- seperti menggunakan deep_research (10 credits) sedangkan fetch_url (1 credit) sudah memadai. Peraturan membetulkan ini dengan mengekod logik pemilihan alat anda secara terus.
Prasyarat
- Cursor dipasang (v0.45+)
- CrawlForge MCP server dipasang:
npm install -g crawlforge-mcp-server - Satu CrawlForge API key (peringkat percuma: 1,000 credits)
Langkah 1: Konfigurasikan CrawlForge sebagai MCP Server
Tambah CrawlForge ke tetapan MCP Cursor anda. Buka Cursor Settings > MCP Servers dan tambah:
{
"mcpServers": {
"crawlforge": {
"command": "crawlforge-mcp-server",
"env": {
"CRAWLFORGE_API_KEY": "cf_live_your_key_here"
}
}
}
}Mulakan semula Cursor. Anda sepatutnya melihat CrawlForge disenaraikan di bawah alat MCP yang tersedia dengan kesemua 26 alat boleh diakses.
Langkah 2: Cipta Fail .cursorrules Anda
Cipta .cursorrules di akar projek anda:
// File: .cursorrules
// This file teaches Cursor how to use CrawlForge tools effectively.
// === CrawlForge MCP Tool Selection ===
// Always use the cheapest CrawlForge tool that accomplishes the task.
// Credit costs: fetch_url(1), extract_text(1), extract_links(1),
// extract_metadata(1), scrape_structured(2), extract_content(2),
// map_site(2), process_document(2), localization(2),
// track_changes(3), analyze_content(3),
// summarize_content(4), crawl_deep(4),
// search_web(5), batch_scrape(5),
// scrape_with_actions(5), stealth_mode(5), deep_research(10)Sekarang mari kita bina setiap kategori peraturan.
Langkah 3: Peraturan Penyelidikan Web
Peraturan ini mengajar Cursor bila perlu mencari web berbanding bila perlu mengambil URL yang diketahui secara terus:
## Web Research with CrawlForge
When I ask you to research a topic or find information online:
1. If I provide a specific URL, use `fetch_url` (1 credit) or `extract_content` (2 credits) -- NEVER use `search_web` for known URLs.
2. If I ask a general question requiring web search, use `search_web` (5 credits) with a focused query.
3. Only use `deep_research` (10 credits) when I explicitly ask for comprehensive multi-source research or when the topic requires cross-referencing multiple sources.
4. After fetching content, use `summarize_content` (2 credits) only if the content exceeds 2,000 words and I need a summary. Do not summarize short pages.
### URL-Known Pattern (1-2 credits)
- "Fetch the Stripe API docs" -> extract_content("https://docs.stripe.com/api")
- "What does this page say?" -> fetch_url(provided_url)
### Search Pattern (5 credits)
- "Find the best TypeScript testing frameworks" -> search_web("best TypeScript testing frameworks 2026")
- "What are competitors charging?" -> search_web("web scraping API pricing comparison")
### Deep Research Pattern (10 credits)
- "Do a comprehensive analysis of MCP adoption" -> deep_research("MCP protocol adoption trends")Langkah 4: Peraturan Pengekstrakan Data
Peraturan untuk memilih alat pengekstrakan yang betul berdasarkan apa yang diperlukan pengguna:
## Data Extraction with CrawlForge
When I ask you to extract data from websites:
1. For plain text content: use `extract_text` (1 credit)
2. For links/navigation: use `extract_links` (1 credit)
3. For page title, description, OG tags: use `extract_metadata` (1 credit)
4. For article content with readability: use `extract_content` (2 credits)
5. For specific elements via CSS selectors: use `scrape_structured` (2 credits)
6. For JavaScript-rendered pages or interactions: use `scrape_with_actions` (5 credits)
7. For anti-bot protected sites: try `fetch_url` first, then `stealth_mode` (5 credits) only if blocked
### Batch Operations
When I need data from 3+ URLs, always use `batch_scrape` (5 credits) instead of calling individual tools in a loop. batch_scrape handles concurrency and is more credit-efficient for bulk operations.
### CSS Selector Examples
When using scrape_structured, provide precise selectors:
- Product prices: `scrape_structured(url, {selectors: {price: ".price", name: "h1.product-title"}})`
- Article lists: `scrape_structured(url, {selectors: {titles: "article h2", links: "article a[href]"}})`Langkah 5: Peraturan Pengoptimuman Credit
Peraturan ini menghalang Cursor daripada membazirkan credits secara tidak perlu:
## Credit Optimization Rules
1. NEVER call the same URL twice in one conversation. Cache the result and reference it.
2. Prefer 1-credit tools over 5-credit tools. The decision tree:
- Do I know the URL? -> fetch_url (1cr) NOT search_web (5cr)
- Do I need clean text? -> extract_text (1cr) NOT extract_content (2cr)
- Can I parse HTML locally? -> fetch_url (1cr) then parse the response
3. Before using scrape_with_actions, try fetch_url first. Many "JavaScript-rendered" pages actually serve content in the initial HTML.
4. Combine operations: fetch_url + local parsing is always cheaper than multiple specialized tool calls.
5. When asked about current credit balance, remind the user to check their dashboard at crawlforge.dev/dashboard.Langkah 6: Peraturan Aliran Kerja Lanjutan
Peraturan untuk aliran kerja scraping yang kompleks dan berbilang langkah:
## Multi-Step Workflows
### Competitive Analysis Workflow
When asked to analyze competitors:
1. search_web to find competitor URLs (5 credits)
2. batch_scrape their pricing/feature pages (5 credits)
3. Present structured comparison table -- do NOT use deep_research unless explicitly asked
### Documentation Indexing Workflow
When asked to index documentation:
1. map_site to discover all doc pages (3 credits)
2. batch_scrape the discovered URLs (5 credits)
3. Store extracted content locally for RAG
### Content Monitoring Workflow
When asked to track website changes:
1. extract_content to capture current state (2 credits)
2. Store baseline locally
3. On subsequent checks, extract_content again and diff against baseline
### Site Audit Workflow
When asked to audit a website:
1. map_site for structure (3 credits)
2. extract_metadata on key pages for SEO data (1 credit each)
3. analyze_content on main pages for quality assessment (3 credits each)Templat .cursorrules Lengkap
Inilah templat penuh yang sedia salin-tampal yang menggabungkan semua peraturan di atas:
# CrawlForge MCP Integration Rules
## Tool Selection Priority (cheapest first)
Always select the lowest-cost CrawlForge tool that accomplishes the task:
- 1 credit: fetch_url, extract_text, extract_links, extract_metadata
- 2 credits: scrape_structured, extract_content, map_site, process_document, localization
- 3 credits: track_changes, analyze_content
- 4 credits: summarize_content, crawl_deep
- 5 credits: search_web, batch_scrape, scrape_with_actions, stealth_mode
- 10 credits: deep_research (use ONLY when explicitly requested)
## Core Rules
1. Known URL -> fetch_url (1cr). NEVER search_web for a known URL.
2. 3+ URLs -> batch_scrape (5cr). NEVER loop individual calls.
3. Try fetch_url before scrape_with_actions. Most pages work without JS rendering.
4. Cache all results. Never fetch the same URL twice per conversation.
5. Only use deep_research when user explicitly asks for multi-source research.
## Output Formatting
- Present scraped data in markdown tables when comparing items
- Include source URLs as references
- Flag any pages that returned errors or empty contentRujukan Kos Credit
| Credits | Alat | Kes Penggunaan Lazim |
|---|---|---|
| 1 | fetch_url, extract_text, extract_links, extract_metadata | Pengambilan halaman pantas, penemuan pautan |
| 2 | scrape_structured, extract_content, map_site, process_document, localization | Pengekstrakan data bersasar, pemetaan laman, pemprosesan dokumen |
| 3 | track_changes, analyze_content | Penjejakan perubahan, analisis kandungan |
| 4 | summarize_content, crawl_deep | Ringkasan, rangkak berbilang halaman |
| 5 | search_web, batch_scrape, scrape_with_actions, stealth_mode | Carian web, operasi pukal, automasi pelayar |
| 10 | deep_research | Analisis menyeluruh berbilang sumber |
Langkah Seterusnya
- Permulaan Pantas CrawlForge -- pasang CrawlForge dalam 60 saat
- Bina Pembantu Penyelidikan -- tutorial projek penuh dengan Claude
- Rujukan 26 Alat -- dokumentasi alat yang lengkap
- awesome-cursorrules di GitHub -- koleksi Cursor rules komuniti
Mula scraping dengan lebih bijak. Daftar secara percuma untuk 1,000 credits, pasang CrawlForge, dan letakkan peraturan ini ke dalam fail .cursorrules anda. Cursor AI anda akan memilih alat yang betul setiap kali.
Cuba sendiri — tiada pendaftaran diperlukan
Jalankan mana-mana daripada 27 alat scraping dan pengekstrakan CrawlForge dalam playground, kemudian mula secara percuma dengan 1,000 credits.
1,000 credits percuma • Isi semula setiap bulan • Tiada kad kredit diperlukan
Tag
Tentang Penulis
Kekal dikemas kini dengan pandangan terkini
Dapatkan tutorial, kemas kini produk dan petua web scraping terus ke peti masuk anda.
Tiada spam. Berhenti melanggan bila-bila masa.