Current location: Home> Ai Course> AI Basics

How to get Cursor to copy the website?

Author: LoRA Time: 26 Feb 2025 1040

Cursor is a powerful AI-driven code editor that can significantly improve development efficiency through natural language prompts and intelligent code generation. Although it does not have a direct "one-click copy website" button itself, combined with its AI capabilities and some external tools such as Firecrawl, you can quickly copy the basic structure and code of a website.

1734961443-gMG38A9DLNlB2Yc0FyUJitXu.jpg

This article will explain in detail how to achieve this with Cursor, for developers who want to quickly clone website prototypes or learn website development.

Specific operation steps

Here are the specific ways to get Cursor AI to copy a website:

1. Preparation

  • Install Cursor : Download and install the latest version from cursor.com .

  • Configure environment : Make sure you are logged in and enabled with advanced models (such as Claude 3.5 Sonnet or GPT-4o). Add your API key in the settings (if needed).

  • Optional tool : Install Firecrawl ( firecrawl.dev ), a website crawl service that integrates with Cursor to provide more detailed website data.

2. Provide website information

  • Method 1: Enter the URL directly

    1. Open Cursor and create a new project folder.

    2. Press Shift + Command + I (Mac) or Shift + Ctrl + I (Windows) to turn on Composer mode.

    3. Enter a natural language prompt, for example:

       rust Copy Edit Clone the website at https://example.com, including its homepage layout, styles, and basic functionality.
    4. Cursor will generate corresponding code files (such as index.html , styles.css , and script.js ).

  • Method 2: Incorporate Firecrawl

    1. Enter the target website URL in Firecrawl to get the crawl result (HTML structure or JSON data).

    2. Copy the result to Cursor's Composer and enter:

       kotlin Copy Edit Use this crawled data to clone the website: [paste Firecrawl output here].
    3. AI generates more precise code based on the crawled content.

  • Method 3: Upload screenshots

    1. Snaps the key pages of the target website.

    2. Click the image icon in Composer to upload the screenshot.

    3. Enter a prompt, for example:

       csharp Copy Edit Generate the HTML and CSS for a website based on this screenshot.

3. Generate and optimize code

  • Click "Submit" to submit the prompt and wait for Cursor to generate the code.

  • Check the generated code file and click "Accept All" to apply the code to the project.

  • If you need to adjust (such as adding interactive functions), highlight the code section, press Ctrl+K (or Cmd+K ) to enter the modification command, for example:

     css copy edit Add a hamburger menu that toggles on mobile screens.

4. Run and test

  • Run a local server in the Cursor terminal (for example, using live-server or python -m http.server ).

  • Open a browser and check if the copied website meets expectations.

  • If there is any error, return to Composer adjustment prompt or manually edit the code.

5. Advanced Tips

  • Multi-page copy : Specify "Include all subpages" in the prompt, Cursor will try to analyze the link and generate a multi-file structure.

  • Context enhancement : Save the document or design rules of the target website as a .md file, reference it (such as @rules.md ), and make the AI output code that is more in line with the original site style.

  • Open Source Example : Refer to the post on X , someone implemented an open source project using Cursor and Firecrawl, which can be used as a template.

With the above method, you can let Cursor quickly copy the basic structure of the website and even implement more complex functions.