gargl
gargl copied to clipboard
Get attribute value
Hi,
I'm using Gargl and it's awesome ! However I have a question : is there any way to get attribute value of an element ?
For exemple get the "href" value ?
Thanks !
Hi,
We don't currently support having anything other than innerHTML of an element returned for a response field.
The correct behavior should be to return the innerHTML for a response field that is not of type input or textarea. For input or textarea return the value property instead. We should also have an attribute capability that lets you say instead of the innerHTML or value, you want the value of a certain attribute of an element returned for a response field. But we don't support any of this right now. Feel free to submit a pull request supporting this functionality :)
The workaround would be to provide the css selector for the parent of the element you want the attribute value for, and then parse this parent's innerHTML for the attribute of the child element you're looking for.