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
Add .get() and .getall() aliases #81
Conversation
Codecov Report
@@ Coverage Diff @@
## master #81 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 4 4
Lines 204 212 +8
Branches 35 36 +1
=====================================
+ Hits 204 212 +8
Continue to review full report at Codecov.
|
+1, I really like this. How do you feel about adding a getall in Selector class as well? |
@eliasdorneles , interesting. would |
Yeah, that's what i was thinking. :)
…On Apr 19, 2017 9:01 AM, "Paul Tremberth" ***@***.***> wrote:
@eliasdorneles <https://github.com/eliasdorneles> , interesting. would
Selector.getall() return a single-element list?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#81 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AACSveyIPd0B1qsjMxvzJXS0-4aFXmBfks5rxgWlgaJpZM4NBhtK>
.
|
@eliasdorneles , done! |
Yesss!! |
Hey @redapple @kmike ! |
I'm all for it. |
It would be ncie to get this one fixed also: #84 |
In quite a few projects, I've been using a
.get()
alias to.extract_first()
as most of the time, getting the first match is what I want.To me,
.extract_first()
feels a bit long to write (I'm probably getting lazy with age...)For cases where I do need to loop on results, I added a
.getall()
alias for.extract()
on.xpath()
and.css()
calls results.I know there's been quite some discussion already to have
.extract_first()
in the first place, but I'm submitting my preference again.