ElementAPI compatible with item getters
Please, provide access to HTML attributes through item getters.
The following code makes three assertions of which only one works.
import operator
import splinter
b = splinter.Browser()
b.visit('https://www.google.com/')
q = b.find_by_name('q').first
assert 'q' == q.get('name')
assert 'q' == operator.itemgetter('name')(q)
assert 'q' == q['name']
I would write the change myself but I have been unable to properly run the test-suite.
Hi, Is this issue still up for fix? I'd like to.
@rg666 Go for it.
Can you please assign to me. @jsfehler
PR 856 provided, would you please review it? Thank you! @jsfehler
@rg666 @medecau Item getters appear to already work. I'll gladly accept unit tests for those behaviours since it appears they go untested at the moment.
I don't see any compelling reason to add .get as a method to ElementAPI
Thank you for the review comments, it was my first PR. Ah, I was working on the review comments. If .get() method isn't required, please let me know. :) @jsfehler @medecau
@rg666 I don't see any bugs involving item getters or missing functionality. I encourage you to write unit tests for the behaviour so we can verify they work. If the unit tests pass, I'll close this issue.
Noted.
I don't see any compelling reason to add .get as a method to ElementAPI
Okay.