Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parse failed #44

Closed
newcoder opened this issue Feb 16, 2012 · 3 comments
Closed

parse failed #44

newcoder opened this issue Feb 16, 2012 · 3 comments
Labels

Comments

@newcoder
Copy link

after load this page: http://sh.58.com/job.shtml, $('body').length == 0? what's wrong? jsdom works.

@matthewmueller
Copy link
Member

Have to give me more than that @newcoder. What's the error say?

My suspicion is that it's not working with unicode characters. Haven't tested it on non-english websites.

@newcoder
Copy link
Author

request({uri: 'http://sh.58.com/job.shtml' }, function(err, response, body){
  var $ = cheerio.load(body),
  $body = $('body');
//no error thrown, but here I saw $body.length==0, $body.html()==null? so I can not do further operations.
//I tried other Chinese pages use cheerio, there was no problem, and I tried this page by jsdom, it also works. it's really weird.

@fb55
Copy link
Member

fb55 commented Apr 8, 2014

For non-UTF8 pages, iconv-lite or similar can be used to fix the charset. Not cheerio's problem.

@fb55 fb55 closed this as completed Apr 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants