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

Incorrect code example in intro documation #3348

Open
VictorPersson opened this issue Aug 27, 2023 · 0 comments
Open

Incorrect code example in intro documation #3348

VictorPersson opened this issue Aug 27, 2023 · 0 comments

Comments

@VictorPersson
Copy link

I was reading the "Basic loading" documentation and pressed the copy button in order to receive the intro code from the docs:

import * as cheerio from 'cheerio';

const $ = cheerio.load('<html><body><h1>Hello, world!</h1></body></html>');

console.log($('title').text());
// Output: Hello, world!

However, the console log turns out empty is empty. This is because it's trying to select and log "title" which does not exist in the provided code: <html><body><h1>Hello, world!</h1></body></html>

So the output "// Output: Hello, world!" is just ""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant