wise-white•16mo ago
htmlToText not defined
I want to convert whole body of html to text. I'm trying this https://crawlee.dev/api/utils/function/htmlToText but its not finding htmlToText function. It says it's not defined. And yes I am doing import as described I am also open to other options like turndown library. I don't want to convert just one element to text but the whole content of the page
3 Replies
working for me after adding:
Also seems to work for me
import { htmlToText } from 'crawlee';
log.info(htmlToText($));
Make sure you are importing it from crawlee and please doublecheck that you are using the latest crawlee version.yeah, we don't mention importing functions in single examples.