Parser

Assembly: ZennoLab.CommandCenter
Full name: ZennoLab.CommandCenter.ZennoPoster.Parser
Kind: abstract


Represents a set of the helper methods to parse page.

Methods

ParseByXpath

Method

IEnumerable<string> ParseByXpath(Tab tab, SourceType sourceType, string xpath, string attribute, bool onlyVisible, bool searchInFrames)

Parse page by XPath.

Parameters

TypeNameDescription
TabtabThe tab to parse.
SourceTypesourceTypeSource type. Parse as DOM or Html.
stringxpathXPath.
stringattributeThe attribute to take.
boolonlyVisibleTrue if parse only visible elements; otherwise, false. Default value is true.
boolsearchInFramesTrue if search inside all frames; otherwise, false. Default value is false.

Returns: The result of parsing data. Returns list of attributes.

Example

var resultParseByXpath = ZennoPoster.Parser.ParseByXpath(instance.ActiveTab, ZennoLab.InterfacesLibrary.Enums.Parser.SourceType.Dom, "//body", "innerText");

Example2

$resultParseByXpath = ZennoPoster\Parser::ParseByXpath(instance.ActiveTab, ZennoLab\InterfacesLibrary\Enums\Parser\SourceType::Dom, "//body", "innerText");

ParseByCssSelector

Method

IEnumerable<string> ParseByCssSelector(Tab tab, SourceType sourceType, string cssSelector, string attribute, bool onlyVisible, bool searchInFrames)

Parse page by CSS-selector.

Parameters

TypeNameDescription
TabtabThe tab to parse.
SourceTypesourceTypeSource type. Parse as DOM or Html.
stringcssSelectorCSS-selector.
stringattributeThe attribute to take.
boolonlyVisibleTrue if parse only visible elements; otherwise, false. Default value is true.
boolsearchInFramesTrue if search inside all frames; otherwise, false. Default value is false.

Returns: The result of parsing data. Returns list of attributes.

Example

var resultParseByCssSelector = ZennoPoster.Parser.ParseByCssSelector(instance.ActiveTab, ZennoLab.InterfacesLibrary.Enums.Parser.SourceType.Dom, "body", "innerText");

Example2

$resultParseByCssSelector = ZennoPoster\Parser::ParseByCssSelector(instance.ActiveTab, ZennoLab\InterfacesLibrary\Enums\Parser\SourceType::Dom, "body", "innerText");

ParseByXpath

Method

IEnumerable<string> ParseByXpath(string source, string xpath, string attribute)

Parse page by XPath.

Parameters

TypeNameDescription
stringsourceHtml document.
stringxpathXPath.
stringattributeThe attribute to take.

Returns: The result of parsing data. Returns list of attributes.

Example

var resultParseByXpath = ZennoPoster.Parser.ParseByXpath("Example", "//body", "innerText");

Example2

$resultParseByXpath = ZennoPoster\Parser::ParseByXpath("Example", "//body", "innerText");

ParseByCssSelector

Method

IEnumerable<string> ParseByCssSelector(string source, string cssSelector, string attribute)

Parse page by CSS-selector.

Parameters

TypeNameDescription
stringsourceHtml document.
stringcssSelectorCSS-selector.
stringattributeThe attribute to take.

Returns: The result of parsing data. Returns list of attributes.

Example

var resultParseByCssSelector = ZennoPoster.Parser.ParseByCssSelector("Example", "body", "innerText");

Example2

$resultParseByCssSelector = ZennoPoster\Parser::ParseByCssSelector("Example", "body", "innerText");