You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
nth:child not limiting to range correctly in p:nth-child(n+2):nth-child(-n+2) #1147
I suggest that you go to https://try.jsoup.org/ and save it so that Jonathan or others can investigate effectively. Since the live url would change content and the screenshot also didn't provide necessary context information. At least you should provide input, expected output and actual output.
If this information can be provided I would also like to have a try to fix it - if it's proved to be a real issue.
Yeah, can you please send a fragment of the HTML so people can look into it/investigate? Without knowing what's in the "li" variable it's hard to see why JSoup fails. I can come up with multiple fragments that could work with the screenshot provided.
Activity
bluetata commentedon Dec 10, 2018
ny83427 commentedon Dec 14, 2018
I suggest that you go to https://try.jsoup.org/ and save it so that Jonathan or others can investigate effectively. Since the live url would change content and the screenshot also didn't provide necessary context information. At least you should provide input, expected output and actual output.
If this information can be provided I would also like to have a try to fix it - if it's proved to be a real issue.
laxika commentedon Dec 27, 2018
Yeah, can you please send a fragment of the HTML so people can look into it/investigate? Without knowing what's in the "li" variable it's hard to see why JSoup fails. I can come up with multiple fragments that could work with the screenshot provided.
Fachher commentedon Mar 12, 2020
The selector does not work correctly, if there are hidden elements present such as
<input type="hidden"/>
jhy commentedon Jan 4, 2021
Please provide a fragment and the selector so anyone can replicate this. Best to use try.jsoup as mentioned.
utosh commentedon Jun 14, 2021
selector:
p:nth-child(n+2):nth-child(-n+2)I want to get 2nd
<p>tag only but returns row2,3,4.Instead of using nth-child(-n+x), I could get expected result by
p:nth-child(n+2):lt(2).thanks!
[-]nth:child(2) not correct[/-][+]nth:child not limiting to range correctly in `p:nth-child(n+2):nth-child(-n+2)`[/+]jhy commentedon Jan 6, 2023
(Confirmed in browser that
p:nth-child(n+2):nth-child(-n+2)will select just the second row)jhy commentedon Jan 14, 2025
Thanks all, fixed, finally :)
Fix parse of :nth-child(-n+2)
chore(deps): update all non-major dependencies (mulk/mulkcms2!58)