A professional-grade dashboard simulation for batch crawling RedNote (Xiaohongshu) data based on keywords. This application demonstrates the logic, scheduling, and anti-ban mechanisms of a web scraper, utilizing Google Gemini AI to generate realistic sample data for demonstration purposes without triggering platform security mechanisms.
- Keyword Management: Input lists of up to 50+ keywords (one per line).
- Configurable Batch Size: Define how many requests to process per batch.
- Items Per Keyword: Configurable depth control (e.g., set to 50 to simulate capturing the top 50 posts per keyword).
- Automated Intervals: Set the scraper to run every
Nhours (Default: 1 hour). - Visual Timer: Displays the countdown to the next execution batch.
- State Management: Supports Start, Stop, and Pause states with graceful abort handling.
To mimic real-world scraping challenges, the app includes configurable safety measures:
- Randomized Delays: Set minimum and maximum wait times between requests (e.g., 1000ms - 3000ms).
- Proxy Rotation: Toggle logic to simulate rotating residential IPs.
- User-Agent Rotation: Toggle logic to simulate different browser fingerprints.
- Real-time Table: View captured data including Title, Content, Author, Likes, Comments, and Date.
- Auto-Sorting: Data is automatically sorted by date (newest first), ensuring you always see the latest posts.
- Excel/CSV Export: One-click export of all collected data to
.csvformat (compatible with Excel).
- Live Console: Real-time logging of scraper actions (Starting batch, processing keyword, success/error status).
- Visual Status: Color-coded logs for easy monitoring.
- Node.js installed.
- A valid Google Gemini API Key.
-
Clone the repository
git clone https://github.com/your-username/rednote-scraper-pro.git cd rednote-scraper-pro -
Install Dependencies
npm install
-
Set up API Key Create a
.envfile in the root and add your key:API_KEY=your_gemini_api_key_here
-
Run the Application
npm start
To replicate the specific manual workflow requested:
- Input Keywords:
- In the left sidebar sidebar, paste your 50 groups of keywords (one keyword per line).
- Configure Settings:
- Set Interval to
1(Run every 1 hour). - Set Items / Key to
50. This ensures the system simulates fetching the latest 50 articles for each keyword. - Set Max Requests / Batch to
2500. - Enable Anti-Ban Measures (Randomize User-Agent & Proxies).
- Set Interval to
- Start Task:
- Click the Start Task Loop button.
- Monitor Execution:
- Watch the Logs Panel. The system will process keywords one by one with random delays to simulate human behavior.
- Observe the "Captured Data" table filling up. The rows are automatically sorted by Date (Newest first).
- Export Results:
- Once the batch is complete, click the Export Excel/CSV button to download the data for analysis.
This application is a simulation. It does not actually scrape xiaohongshu.com directly, as client-side scraping is restricted by CORS and security policies. Instead, it uses AI (Gemini) to generate realistic data structures that match the platform's format, allowing developers to test UI, scheduling logic, and data handling pipelines safely.