You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 to get() and getall().
It would be a boolean value, and when it's true, Parsel would call strip() on every match.
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() and re_first() but it's overkill and hides the intent.
Best regards,
Benoit
The text was updated successfully, but these errors were encountered:
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: