externalAttribute <Native_Element_Type>
Hierarchy
- Question<Promise<string>>
- Attribute
Implements
- MetaQuestion<PageElement<Native_Element_Type>, Question<Promise<string>>>
- Optional
Index
Methods
staticexternalcalled
Instantiates a
Question
that uses the actor's ability toBrowseTheWeb
to retrieve the value of the specified HTML attribute of a givenPageElement
.Type parameters
- NET = any
Parameters
externalname: Answerable<string>
The name of the attribute to retrieve
Returns Attribute<NET>
externaldescribedAs
Changes the description of this object, as returned by
Describable.describedBy
andDescribable.toString
.Parameters
externaldescription: Answerable<string> | MetaQuestion<string, Question<Promise<string>>>
Replaces the current description according to the following rules:
- If
description
is anAnswerable
, it replaces the current description - If
description
is aMetaQuestion
, the current description is passed ascontext
todescription.of(context)
, and the result replaces the current description
- If
Returns this
externalas
Maps this question to one of a different type.
Question.about('number returned as string', actor => '42') // returns: QuestionAdapter<string>
.as(Number) // returns: QuestionAdapter<number>Type parameters
- O
Parameters
externalmapping: (answer: string) => O | Promise<O>
Returns QuestionAdapter<O>
externaldescribedBy
Resolves the description of this object in the context of the provided
actor
.Parameters
externalactor: AnswersQuestions & UsesAbilities & { name: string }
Returns Promise<string>
externaltoString
Returns a human-readable description of this object.
Returns string
externalof
Parameters
externalpageElement: PageElement<Native_Element_Type> | QuestionAdapter<PageElement<Native_Element_Type>>
Returns MetaQuestionAdapter<PageElement<Native_Element_Type>, string>
externalansweredBy
Parameters
externalactor: AnswersQuestions & UsesAbilities
Returns Promise<string>
externalisPresent
Returns QuestionAdapter<boolean>
Uses the actor's ability to
BrowseTheWeb
to retrieve the value of the specified HTML attribute of a givenPageElement
.Example widget
Retrieve an HTML attribute of a given
PageElement
Using
Attribute
asQuestionAdapter
Using as filter in Page Element Query Language
Learn more
BrowseTheWeb
MetaQuestion
QuestionAdapter
Question