0

I am using cheerio to modify HTML that i am scraping from a website. However it is messing up quoats.

This script works fine, the only issue is, it is changing ' to "

       // Load in HTML
       $ = cheerio.load(string);
       console.log($.html());   

It is changing:

     <script>window.jQuery || document.write("<script src='//cdn.shopify.com/s/files/1/0967/6522/t/2/assets/jquery.min.js?15981737959390328713'>\x3C/script>")</script>

To:

    <script>window.jQuery || document.write("<script src="//cdn.shopify.com/s/files/1/0967/6522/t/2/assets/jquery.min.js?15981737959390328713">\x3C/script>")</script>
Wiktor Stribiżew
  • 607,720
  • 39
  • 448
  • 563
Jay Povey
  • 127
  • 1
  • 11

1 Answers1

2

It looks like you ran into issue #720 on the Cheerio issue tracker. They said they won't fix it, but you might convince them with your use case. I suggest commenting on the issue there.

Avaq
  • 3,009
  • 1
  • 21
  • 25