Skip to content

Tag: node.js

Nodejs trim() is not a function

I get this error when I run and can not seem to resolve it. TypeError: data[key].trim is not a function The function is this one I am not sure how to solve this problem Answer I think there is a possibility what data[key] isn’t a string type. try this: Change if(data[key] !== “”) to if(typeo…

Puppeter delete node inside element

I want to scrape a page with some news inside. Here it’s an HTML simplified version of what I have : I want to get the author and text body of each news, without the blockquote part. So I wrote this code : It works well, but I don’t know how to remove the blockquote part of the “news-body&#8…