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
| Параметр | Описание |
|---|---|
tab | The tab to parse. |
sourceType | Source type. Parse as DOM or Html. |
xpath | XPath. |
attribute | The attribute to take. |
onlyVisible | True if parse only visible elements; otherwise, false. Default value is true. |
searchInFrames | True 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
| Параметр | Описание |
|---|---|
tab | The tab to parse. |
sourceType | Source type. Parse as DOM or Html. |
cssSelector | CSS-selector. |
attribute | The attribute to take. |
onlyVisible | True if parse only visible elements; otherwise, false. Default value is true. |
searchInFrames | True 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
| Параметр | Описание |
|---|---|
source | Html document. |
xpath | XPath. |
attribute | The 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
| Параметр | Описание |
|---|---|
source | Html document. |
cssSelector | CSS-selector. |
attribute | The 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");