HtmlNode

Retrieves an HTML Node via XPath query

  • Free Function
  • SQL Server Compatibility: 2008, 2012, 2014, 2016, 2017

Syntax:

SELECT SQLHTTP.net.HTMLNode ( @Html, @Xpath, @Index )

Arguments:

Name Type Description
@Html nvarchar(MAX) String containing HTML
@Xpath nvarchar(MAX) An Xpath query
@Index bigint Index position of the XPath query result

Return Type:

nvarchar(MAX)

Sample Usage:

This example demonstrates retrieving the first <tr> tag from an HTML Table:

See Also: