CSS Selector :nth-of-type and :nth-of-child only work up to 9
Bug #1811206 reported by
Marcus Näslund
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Beautiful Soup |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
Using BS4 4.7.1 (Soupsieve 1.6.2) on Python 3.6.
When using the nth-of-type or nth-child pseudo classes in CSS selectors (soup.select()), they only work up to 9, and from 10 upwards either return nothing or the wrong element, depending on the document. I.e. div:nth-of-type(9) always works, div:nth-of-type(10) never(?) works. I've attached a simple example.
However, formulas like :nth-child(9+n) seem to work well and returns all elements from the 9th onwards.
I don't know if this bug goes here or to Soupsieve.
To post a comment you must log in.
Oops, the attached document always says "expect 9" when of course sometimes expected element is 10 or 11, but should be obvious what was meant.