hackerwgf
376.68D
V2EX  ›  Node.js

cheerio 爬虫偶尔遇到中文乱码�

  •  
  •   hackerwgf · Dec 27, 2017 · 5900 views
    This topic created in 3242 days ago, the information mentioned may be changed or developed.
    基本都是 utf8 的网页,用 cheerio 解析出的结果偶尔会遇到�,然后下一次就又正常了,各位朋友有遇到类似情况的没?
    2 replies  •  2017-12-28 09:33:28 +08:00
    jeneser
    jeneser
    Dec 27, 2017 via Android❤️1
    1
    可以试试 superagent-charset
    123s
    123s
    Dec 28, 2017❤️1
    2
    不设 encoding 好像会是 buffer,再转
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   996 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 22:13 · PVG 06:13 · LAX 14:13 · JFK 17:13
    ♥ Do have faith in what you're doing.