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

complex CSS selectors #8

Open
rennat opened this issue Aug 4, 2011 · 6 comments
Open

complex CSS selectors #8

rennat opened this issue Aug 4, 2011 · 6 comments
Assignees

Comments

@rennat
Copy link
Owner

rennat commented Aug 4, 2011

Pynliner currently fails to apply the selector element#id.class.

Other selectors that fail include adjacent sibling (a + b) and child (a > b) selectors as well as pseudo selectors (not sure if pseudo selectors should be included... thoughts anyone?)

@ghost ghost assigned rennat Aug 4, 2011
@adam-p
Copy link

adam-p commented Feb 8, 2013

+1 for pseudo selectors. I found out that they're not supported when I tried to zebra-stripe a table with :nth-child.

@5p4k
Copy link

5p4k commented Oct 13, 2013

Also :not( ) isn't supported. Pynliner fails raising an exception: https://github.com/rennat/pynliner/blob/master/pynliner/soupselect.py#L103.
Until pseudo selectors get supported, I suggest Pynliner to ignore them instead of failing: a partial result is better than none. Besides, the selector could be included in a css file but not actually match any tag.

@rennat
Copy link
Owner Author

rennat commented Oct 13, 2013

I think we should support pseudo selectors. Also any errors should log warning but continue rendering the remaining selectors. These are good improvements to make and I'm sure I'll get to them eventually but I'll also accept pull requests!

@p-himik
Copy link
Contributor

p-himik commented Jun 1, 2016

Why is not a bug anymore? It fails to apply even a selector like .class1.class2.
classes = re.findall('\.([a-zA-Z0-9_-]+)', token) in soupselect.py is definitely not a correct way to do it.

@rennat
Copy link
Owner Author

rennat commented Jun 1, 2016

@p-himik , If you have some HTML and CSS that isn't being handled correctly, the most productive thing you can do here is to fork this repository and add a test showing the failure then open a pull request. I'll pull in failing tests if they highlight problems in pynliner so we can fix them.

@p-himik
Copy link
Contributor

p-himik commented Jun 1, 2016

Created #46

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

No branches or pull requests

4 participants