-
Notifications
You must be signed in to change notification settings - Fork 135
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
Adding a strip
kwarg to get()
and getall()
#249
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
Thank you very much for this excellent library ❤️
I've been using Parsel for a while and I constantly find myself calling
.strip()
after.get()
or.getall()
.I think it would be very helpful if Parsel provided a built-in mechanism for that.
I suggest adding a
strip
kwarg toget()
andgetall()
.It would be a boolean value, and when it's true, Parsel would call
strip()
on every match.Example with
get()
:Example with
getall()
:Alternatively, we could change the
::text
pseudo-element to support an argument, like::text(strip=1)
.That would be extremely handy too and probably more flexible than my original suggestion, but also more difficult to implement.
I know I could strip whitespaces with
re()
andre_first()
but it's overkill and hides the intent.Best regards,
Benoit
The text was updated successfully, but these errors were encountered: