I am extracting metatags from page:
$ = cheerio.load(html)
metaTags = $('meta')
and it works fine, but I need that metaTags array contain strings - not objects of cherrio, like here:
["<'meta something=1231'><'/meta'>", "<'meta sometag=44242'><'/meta'>"]
p.s. I dont need ' character it just stackoverflow.com missunderstaning
I have made such , method:
toHtml = (el) ->
return el.html()
but it doesnt work : getting empty results (using map with it)
metaTags.map (i, el) -> console.log i.toHtml(el)
let arrayOfHTMLstrings = $('meta').toArray().map( (el, index) => el.toString() );
According to cheerio official doc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With