We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
From https://cheerio.js.org/docs/basics/selecting
Have a command documentation that inform you can select elements based on their position, like
const $p = $('p:first');
but if I want select $p = $('div div.first button').attr('onclick') it returns null.
if I write just $('div div button').attr('onclick'),
it returns the first value
Always I need do $('div div button').each((index,value) => $(value).attr('onclick')
(yes, the comand 'each' return the div>div elements).
And discard the 2 first elements to get my value.
I think it be more simple like $('div div[2] button').attr('onclick')
Selecting the div position with "[2]", like an array element position.
Exist some form that I can't need make the 'each' command to return the values from 3th div?
If I write like the div:second, Google App Script retuns "Error: unmatched pseudo-class :second"
Thanks
The text was updated successfully, but these errors were encountered:
What version of Cheerio are you using? Note that positional selectors are only available in the latest RC release.
Sorry, something went wrong.
No branches or pull requests
From https://cheerio.js.org/docs/basics/selecting
Have a command documentation that inform you can select elements based on their position, like
const$p = $ ('p:first');
but if I want select$p = $ ('div div.first button').attr('onclick') it returns null.
if I write just
$('div div button').attr('onclick'),
it returns the first value
Always I need do
$('div div button').each((index,value) =>
$(value).attr('onclick')
(yes, the comand 'each' return the div>div elements).
And discard the 2 first elements to get my value.
I think it be more simple like
$('div div[2] button').attr('onclick')
Selecting the div position with "[2]", like an array element position.
Exist some form that I can't need make the 'each' command to return the values from 3th div?
If I write like the div:second, Google App Script retuns "Error: unmatched pseudo-class :second"
Thanks
The text was updated successfully, but these errors were encountered: