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
Using cssselect 0.9.1, the :nth-last-child selector starts from 0 instead of 1, that is, :nth-last-child(0) selects the last element when it should instead select nothing.
Thanks for the report! To be honest I’m unlikely to fix this myself. I believe the entire approach of translating Selectors to XPath is flawed (see #12 (comment) for example), and so I don’t really want to do more work on cssselect. I’ve started cssselect2 that implements Selectors "for real", but it’s blocked on some non-obvious design decisions: Kozea/cssselect2#1
Using cssselect 0.9.1, the
:nth-last-child
selector starts from 0 instead of 1, that is,:nth-last-child(0)
selects the last element when it should instead select nothing.Here is an example using lxml:
Output:
Expected output:
The text was updated successfully, but these errors were encountered: