Type
Type: type
Request that the browser enter a specific piece of text into a field.
Parameters
text
string
The text the browser should enter into the text field.
See universal parameters.
Usage
Type into a text box
The following action will type into a particular text field.
"actions": [
{
"type": "type",
"selector": "#postform-text",
"text": "Hello world!"
}
]FAQs
When do I use the type action?
Use it to enter text into a field — a search box, a login form, a filter. For checkboxes, radio buttons and dropdowns, use click instead.
How do I fill in a form field with Gaffa?
Add a type action with a selector for the input and the text you want entered. Gaffa types the characters one at a time, as a person would.
Does the type action submit the form?
No. It only enters the text. Add a click for the submit button afterwards, then a wait for something on the next page before you capture anything.
How do I fill in more than one field?
Add one type action per field, in the order someone would fill them in. Finish with a click on the submit button and a wait for the result.
Why isn't my type action working?
Usually the selector points at the wrapper rather than the input, the field hasn't loaded yet, or a cookie banner or modal is sitting over it. Target the input directly, add a wait for slow forms, and close any overlay first.
How do I write an attribute selector inside JSON?
Use single quotes inside the selector, like "input[name='email']", or escape the double quotes with backslashes: "input[name=\"email\"]". Unescaped double quotes will break the request.
Does Gaffa's typing avoid bot detection?
Gaffa types character by character with real keyboard events instead of dropping the whole string in at once, which handles sites that watch for that. It won't defeat every detection method.
Last updated