user8283671
user8283671

Reputation:

Web scraping Nodejs cheerio

I have to get content of <script> tag in website. But there are many <script> tags and with no id attribute. Cheerio doesn't get <script> tag content when I call it like this:

$('script').text()

or

.html();

What is the way to do this?

Upvotes: 0

Views: 107

Answers (1)

hong4rc
hong4rc

Reputation: 4103

You should use $('script').html()

Upvotes: 1

Related Questions