Skip to content

Unmatched css selector, and invalid regex in codebase #40

@ghost

Description

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\-#.:*"\'\[\]\(\)=]+$

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions