Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ElementAPI compatible with item getters

See original GitHub issue

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()
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.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9

github_iconTop GitHub Comments

jsfehlercommented, Feb 11, 2021

@rg666 Go for it.

jsfehlercommented, Feb 12, 2021

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating a Simple Component Using the Element API | Flow
In this section, we demonstrate how to create a simple component using the Element API and a single DOM element.
Read more >
Create a JSON API/Feed for your elements in Craft. - GitHub
Element API for Craft CMS. This plugin makes it easy to create a JSON API for your entries (and other element types) in...
Read more >
Using custom elements - Web Components | MDN
The controller of custom elements on a web document is the CustomElementRegistry object — this object allows you to register a custom ...
Read more >
Lifecycle -
LitElement uses Promise objects to schedule and respond to element updates. ... method instead of the updateComplete getter to ensure compatibility with ...
Read more >
With Element API, can I combine two entry types into a JSON ...
I'm using Craft as a headless CMS, so I wanted full control over the JSON it was returning. I didn't figure out how...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found