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
| Type | Name | Description |
|---|---|---|
Tab | tab | The tab to parse. |
SourceType | sourceType | Source type. Parse as DOM or Html. |
string | xpath | XPath. |
string | attribute | The attribute to take. |
bool | onlyVisible | True if parse only visible elements; otherwise, false. Default value is true. |
bool | 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
IEnumerable<string> ParseByCssSelector(Tab tab, SourceType sourceType, string cssSelector, string attribute, bool onlyVisible, bool searchInFrames)
Parse page by CSS-selector.
Parameters
| Type | Name | Description |
|---|---|---|
Tab | tab | The tab to parse. |
SourceType | sourceType | Source type. Parse as DOM or Html. |
string | cssSelector | CSS-selector. |
string | attribute | The attribute to take. |
bool | onlyVisible | True if parse only visible elements; otherwise, false. Default value is true. |
bool | 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
IEnumerable<string> ParseByXpath(string source, string xpath, string attribute)
Parse page by XPath.
Parameters
| Type | Name | Description |
|---|---|---|
string | source | Html document. |
string | xpath | XPath. |
string | 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
IEnumerable<string> ParseByCssSelector(string source, string cssSelector, string attribute)
Parse page by CSS-selector.
Parameters
| Type | Name | Description |
|---|---|---|
string | source | Html document. |
string | cssSelector | CSS-selector. |
string | 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");