Readability
AI-generatedOverview
This node extracts readable content from HTML input using Mozilla's Readability library. It is useful for scenarios where you need to parse and clean up HTML content to get the main article or readable text, such as processing web-scraped HTML or cleaning up HTML emails. The node outputs the extracted content, title, and excerpt, or optionally the full response including metadata.
Use Case Examples
- Extracting the main article content from a web page's HTML for further processing or analysis.
- Cleaning up HTML email content to get a plain readable summary.
Properties
| Name | Meaning |
|---|---|
| HTML Field | The field containing the HTML content to parse. |
| Error Handling | How to handle invalid HTML content. |
| Return Full Response | Whether to return the full response from Readability (includes metadata). |
Output
JSON
content- The main readable content extracted from the HTML.title- The title of the extracted content.excerpt- A short excerpt or summary of the content.
Dependencies
- Mozilla Readability library
- jsdom library
Troubleshooting
- If the node throws an error about missing JSON data, ensure the input item contains a JSON object.
- If the HTML content is invalid or cannot be parsed, the node behavior depends on the 'Error Handling' setting: it can pass through the input, output empty content, or throw an error.
- Errors related to HTML parsing failures indicate the input HTML might be malformed or empty.
Links
- Mozilla Readability GitHub - Official repository of the Mozilla Readability library used for extracting readable content from HTML.
- jsdom GitHub - Library used to simulate a DOM environment for parsing HTML in Node.js.