Find-HtmlBrowserLocator
August 3, 2026 ยท View on GitHub
SYNOPSIS
Finds ranked locator candidates for resilient browser automation.
SYNTAX
__AllParameterSets
Find-HtmlBrowserLocator [[-Session] <HtmlBrowserSession>] [[-Query] <string>] [-IncludeHidden] [-Limit <int>] [-CancellationToken <CancellationToken>] [<CommonParameters>]
DESCRIPTION
Finds ranked locator candidates for resilient browser automation.
EXAMPLES
EXAMPLE 1
$session = Start-HtmlBrowserSession -Url https://example.org/search
$locator = Find-HtmlBrowserLocator -Session $session -Query Search | Select-Object -First 1
$locator | Select-Object Strategy, Selector, SuggestedCommand, TestCommand, Warnings
PARAMETERS
-CancellationToken
Token used to cancel the operation.
Type: CancellationToken
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-IncludeHidden
Include hidden candidates.
Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Limit
Maximum number of candidates to return.
Type: Int32
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Query
Optional text, label, id, name, placeholder, href, or selector fragment to filter candidates.
Type: String
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Session
Existing browser session. When omitted, the default PSParseHTML session is used.
Type: HtmlBrowserSession
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
HtmlTinkerX.HtmlBrowserSession
OUTPUTS
HtmlTinkerX.HtmlBrowserLocatorCandidate
RELATED LINKS
- None