Parser

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


Represents a set of the helper methods to parse page.

Methods

ParseByXpath

Method

Parse page by XPath.

Parameters

ПараметрОписание
tabThe tab to parse.
sourceTypeSource type. Parse as DOM or Html.
xpathXPath.
attributeThe attribute to take.
onlyVisibleTrue if parse only visible elements; otherwise, false. Default value is true.
searchInFramesTrue 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

Parse page by CSS-selector.

Parameters

ПараметрОписание
tabThe tab to parse.
sourceTypeSource type. Parse as DOM or Html.
cssSelectorCSS-selector.
attributeThe attribute to take.
onlyVisibleTrue if parse only visible elements; otherwise, false. Default value is true.
searchInFramesTrue 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

Parse page by XPath.

Parameters

ПараметрОписание
sourceHtml document.
xpathXPath.
attributeThe 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

Parse page by CSS-selector.

Parameters

ПараметрОписание
sourceHtml document.
cssSelectorCSS-selector.
attributeThe 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");