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

Unmatched css selector, and invalid regex in codebase #40

Open
ghost opened this issue Aug 17, 2015 · 1 comment
Open

Unmatched css selector, and invalid regex in codebase #40

ghost opened this issue Aug 17, 2015 · 1 comment

Comments

@ghost
Copy link

ghost commented Aug 17, 2015

The exception message given is not very clear; I recommend making it clear.

    raise Exception("No match was found. We're done or something is broken")

I used the debugger to extract the failing css selector:

.my-class table tr:nth-child(2n) does not match the regex'([_0-9a-zA-Z-#.:*"\'\[\\]=]+)$ (This expression doesn't compile in my regex tools. The closest working regexp I could come to is:[_0-9a-zA-Z\-#.:*"\'\[\]=]+$).

I find that the regex is missing parenthesis captures.

With \(\) added the working regex expression does match the selector.

Suggested change the regexp here to:
pynliner/soupselect.py:98 [_0-9a-zA-Z\-#.:*"\'\[\]\(\)=]+$

@rennat
Copy link
Owner

rennat commented Apr 5, 2016

Yeah this error should be better.

As far as the :nth-child() pseudo selector, pynliner currently doesn't support any pseudo selectors that take arguments. It's simply not smart enough yet 😞

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

1 participant