Библиотека / Веб-скрейпинг и исследования
Веб-скрейпинг и исследования
Очистка HTML-страниц и конвертация в Markdown для обработки OpenAI
Подворкфлоу, которое вызывают другие воркфлоу: удаляет скрипты, медиа и комментарии из загруженных страниц, при необходимости заменяет URL и изображения и конвертирует остальное в Markdown для OpenAI.
Что делает
## Post-processing of the HTML page: 1. Keep only content 2. Remove inline tag entirely, as well as: NOSCRIPT, IFRAME, OBJECT, EMBED, VIDEO, AUDIO, SVG, and HTML comments. 3. In case query parameter method=simplified, replace all page URLs (a href) and IMG (src) with NOURL / NOIMG - this may save up to 20% of the page length 4. Convert the remaining HTML to Markdown. This step further reduces the length of the page: long HTML tags and styles are eliminated, but the markdown syntax keeps some page structure. This gives much better results compared to just a blank text. 5. Finally, check the page length. If it's too long, send an "ERROR: PAGE CONTENT TOO LONG" instead of the actual page. Of course, you could split the page content in chunks, but sometimes long pages just don't have a needed content, so it makes little sense to burn tokens on them.
Шаги
- When chat message received
- AI Agent
- OpenAI Chat Model1
- When Executed by Another Workflow
- QUERY_PARAMS
- CONFIG
- HTTP Request
- Is error?
- Stringify error message
- Exctract HTML Body
- Remove extra tags
- Simplify?
- Simplify output
- Convert to Markdown
Всего шагов: 16.
Похожие автоматизации
Документы, PDF и OCRПреобразование полей Markdown в Baserow в HTMLШагов: 8Написание и генерация контентаПреобразование Markdown из Baserow в HTMLШагов: 18Документы, PDF и OCRПреобразование полей Markdown в Airtable в HTMLШагов: 8Написание и генерация контентаПреобразование Markdown из Airtable в HTML через webhookШагов: 18