ConvertFrom-HtmlAttributes
August 3, 2026 ยท View on GitHub
SYNOPSIS
Extracts HTML elements by tag, class, id or name attributes.
SYNTAX
Content (Default)
ConvertFrom-HtmlAttributes -Content <string> [-Tag <string>] [-Class <string>] [-Id <string>] [-Name <string>] [-Proxy <string>] [-ProxyCredential <pscredential>] [-ReturnObject] [<CommonParameters>]
File
ConvertFrom-HtmlAttributes -Path <string> [-Tag <string>] [-Class <string>] [-Id <string>] [-Name <string>] [-Proxy <string>] [-ProxyCredential <pscredential>] [-ReturnObject] [<CommonParameters>]
Url
ConvertFrom-HtmlAttributes -Url <uri> [-Tag <string>] [-Class <string>] [-Id <string>] [-Name <string>] [-Proxy <string>] [-ProxyCredential <pscredential>] [-ReturnObject] [<CommonParameters>]
DESCRIPTION
Input can be raw HTML or a page retrieved from -Url. Use -Proxy when the page must be downloaded through a proxy server.
EXAMPLES
EXAMPLE 1
ConvertFrom-HtmlAttributes -Url https://example.com -Tag a
EXAMPLE 2
ConvertFrom-HtmlAttributes -Url https://example.com -Proxy http://proxy:8080 -Tag a
PARAMETERS
-Class
Class name to search for.
Type: String
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Content
HTML content to parse.
Type: String
Parameter Sets: Content
Aliases: None
Possible values:
Required: True
Position: named
Default value: None
Accept pipeline input: True (ByValue, ByPropertyName)
Accept wildcard characters: False
-Id
ID attribute to search for.
Type: String
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Name
Name attribute to search for.
Type: String
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Path
Path to an HTML file.
Type: String
Parameter Sets: File
Aliases: File
Possible values:
Required: True
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Proxy
Proxy server address used when Url is specified. Include protocol and port if necessary.
Type: String
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProxyCredential
Credentials used with the Proxy server.
Type: PSCredential
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ReturnObject
Return matching IElement objects instead of text.
Type: SwitchParameter
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Tag
Tag name to search for.
Type: String
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Url
URL of HTML page to download.
Type: Uri
Parameter Sets: Url
Aliases: Uri
Possible values:
Required: True
Position: named
Default value: None
Accept pipeline input: False
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
System.String
OUTPUTS
System.StringAngleSharp.Dom.IElement
RELATED LINKS
- None