Returns a string object from the HTML or XML response content that matches the
given XPath expression.
Namespace: Facilita.WebAssembly: clrWebBrowser (in clrWebBrowser.dll) Version: 9.5.8.37 (1.0.0.0)
Syntax
public virtual string ExtractXPath( string xpathExpression, ActionType failAction )
Parameters
- xpathExpression
- Type: System String
The XPath expression to be applied to the response content.
- failAction
- Type: Facilita.Fc.Runtime ActionType
The action to take if the extract failed.
Return Value
The extracted text, or an empty string if the extract failed.Remarks
Examples
Response response = request.Send(); Set<string>("xpathExtractVariable", response.ExtractXPath("/html/body/h1", ActionType.ACT_WARNING)); // Check if a value was extracted. if (GetString("xpathExtractVariable").Length > 0) { WriteMessage(String.Format("xpathExtractVariable: {0}", GetString("xpathExtractVariable"))); } else { WriteMessage("XPath extract found no match"); }
See Also