Parser component
Description
Performs parsing of any text structures. Regular expression method, JSON search method, built-in hypertext analyzer can be used. According to the search string, generates a response, either cutting the requested section or a set of them, or determines the number of elements in the specified section of the structure. Complex structures can be parsed by a sequence of "Parser" elements, each of which extracts some structure from the document and returns it for passing to the input of the next element.
The parsed document structure is cached in a specific instance of the script handler to speed up the handling of one large document of consecutive Parser elements».
Index |
|
Short title |
|
Types of scenarios |
|
Starter module |
|
Mode |
Synchronous |
Icon |
![]() |
Branching pattern |
Branching, closing |
Properties
Specification | Description |
---|---|
Title: |
Argument with the content of the document to be parsed. |
Title: |
Parsing Algorithm.
|
Title: |
String with the search query for the selected algorithm. |
Title: |
Function for the
|
Title: |
Function for the
|
Title: |
Function for the
|
Title: |
Function for the
|
Title: |
Parameter for the |
Title: |
Parameter for the For example, in the document |
Title: |
Parameter for algorithms |
Title: |
Parameter for algorithms |
Title: |
Variable to save the result of the operation. |
Title: |
A list of sequentially executing additional queries and assigning the results to a variable. If the field is filled, the main query is executed first, and then all additional queries are executed with the same parameters.
|
Title: |
Variable to save the error. |
Title: |
The component to which control is passed on successful completion of the operation. |
Title: |
Component to which control is passed when an error occurs. |
Examples
Algorithm JSON
Overview
-
When parsing an array of objects, you can specify a filter in
(key:value)
, only objects with the specified key-value pair will be used for further parsing. The filter can be on only one key-value pair. For example:"msgs"("msgSender": "ab")
, "msgs" - contains an array of objects from which objects with the presence of the property will be selected "msgSender"="ab". -
Numbering of array elements starts with 0.
{
"result": "ok",
"errormsg": "",
"chat": [
{
"sessId": "uvajoqnx0qcpbjoflxr",
"msgs": [
{
"msgId": 8255,
"msgDt": 1491292390,
"msgData": {
"type": "text",
"data": "Good afternoon. Select the question you are interested in."
},
"msgSender": "op"
},
{
"msgId": 8256,
"msgDt": 1491292391,
"msgData": {
"type": "buttons",
"data": "Contact usr 6"
},
"msgSender": "ab"
},
{
"msgId": 8257,
"msgDt": 1491292392,
"msgData": {
"type": "buttons",
"data": "Contact usr 8"
},
"msgSender": "ab"
}
]
}
]
}
Search Query | Function | Result |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[ { "msgId": 8256, "msgDt": 1491292391, "msgData": { "type": "buttons", "data": "Contact usr 6" }, "msgSender": "ab" }, { "msgId": 8257, "msgDt": 1491292392, "msgData": { "type": "buttons", "data": "Contact usr 8" }, "msgSender": "ab" } ] . |
|
|
|
|
|
|
Algorithm XML
<configuration version="16">
<folder id="x.okteller.ru" label="x.okteller.ru" path="c:\rtx_mg3\Media\domains\x.okteller.ru" type="readwrite" rescanIntervalS="10" ignorePerms="false" autoNormalize="true">
<device id="RXYYDPI-SVKNBMF-YADG7WD"></device>
<minDiskFreePct>1</minDiskFreePct>
<versioning></versioning>
<copiers>0</copiers>
<pullers>0</pullers>
<hashers>0</hashers>
<order>random</order>
</folder>
<folder id="okteller.ru" label="okteller.ru" path="c:\rtx_mg3\Media\domains\okteller.ru" type="readwrite" rescanIntervalS="10" ignorePerms="false" autoNormalize="true">
<device id="RXYYDPI-SVKNBMF-YADG7WD"></device>
<minDiskFreePct>1</minDiskFreePct>
<versioning></versioning>
<copiers>0</copiers>
<pullers>0</pullers>
<hashers>0</hashers>
<order>random</order>
</folder>
<folder id="Common" label="Common" path="c:\rtx_mg3\Media\common" type="readwrite" rescanIntervalS="10" ignorePerms="false" autoNormalize="true">
<device id="RXYYDPI-SVKNBMF-YADG7WD"></device>
<minDiskFreePct>1</minDiskFreePct>
<versioning></versioning>
<copiers>0</copiers>
<pullers>0</pullers>
<hashers>0</hashers>
<order>random</order>
</folder>
<device id="RXYYDPI-SVKNBMF-YADG7WD" name="Pavel" compression="metadata" introducer="false">
<address>dynamic</address>
</device>
<gui enabled="true" tls="false" debugging="false">
<address>127.0.0.1:8384</address>
<apikey>jeopL9MghPvTmweKDeGcoXhwRtrdaVDP</apikey>
<theme></theme>
</gui>
<options>
<globalAnnounceEnabled>false</globalAnnounceEnabled>
<localAnnounceEnabled>false</localAnnounceEnabled>
<localAnnouncePort>21027</localAnnouncePort>
<localAnnounceMCAddr></localAnnounceMCAddr>
<maxSendKbps>0</maxSendKbps>
<maxRecvKbps>0</maxRecvKbps>
<reconnectionIntervalS>60</reconnectionIntervalS>
<relaysEnabled>false</relaysEnabled>
<relayReconnectIntervalM>10</relayReconnectIntervalM>
<startBrowser>false</startBrowser>
<natEnabled>false</natEnabled>
<natLeaseMinutes>60</natLeaseMinutes>
<natRenewalMinutes>30</natRenewalMinutes>
<natTimeoutSeconds>10</natTimeoutSeconds>
</options>
</configuration>
Search Query | Function | Result |
---|---|---|
|
|
<folder id="Common" label="Common" path="c:\rtx_mg3\Media\common" type="readwrite" rescanIntervalS="10" ignorePerms="false" autoNormalize="true"> <device id="RXYYDPI-SVKNBMF-YADG7WD"/> <minDiskFreePct>1</minDiskFreePct> <versioning/> <copiers>0</copiers> <pullers>0</pullers> <hashers>0</hashers> <order>random</order> </folder> <folder id="rootdomain.ru" label="rootdomain.ru" path="c:\rtx_mg3\Media\domains\rootdomain.ru" type="readwrite" rescanIntervalS="10" ignorePerms="false" autoNormalize="true"> <device id="RXYYDPI-SVKNBMF-YADG7WD"/> <minDiskFreePct>1</minDiskFreePct> <versioning/> <copiers>0</copiers> <pullers>0</pullers> <hashers>0</hashers> <order>random</order> </folder> <folder id="x.rootdomain.ru" label="x.rootdomain.ru" path="c:\rtx_mg3\Media\domains\x.rootdomain.ru" type="readwrite" rescanIntervalS="10" ignorePerms="false" autoNormalize="true"> <device id="RXYYDPI-SVKNBMF-YADG7WD"/> <minDiskFreePct>1</minDiskFreePct> <versioning/> <copiers>0</copiers> <pullers>0</pullers> <hashers>0</hashers> <order>random</order> </folder> . |
|
|
<device id="RXYYDPI-SVKNBMF-YADG7WD"/> . |
|
|
<folder id="x.rootdomain.ru" label="x.rootdomain.ru" path="c:\rtx_mg3\Media\domains\x.rootdomain.ru" type="readwrite" rescanIntervalS="10" ignorePerms="false" autoNormalize="true"> <device id="RXYYDPI-SVKNBMF-YADG7WD"/> <minDiskFreePct>1</minDiskFreePct> <versioning/> <copiers>0</copiers> <pullers>0</pullers> <hashers>0</hashers> <order>random</order> </folder> . |
|
<device id="RXYYDPI-SVKNBMF-YADG7WD"/> <minDiskFreePct>1</minDiskFreePct> <versioning/> <copiers>0</copiers> <pullers>0</pullers> <hashers>0</hashers> <order>random</order> . |
|
|
|
|
|
|
|
|
|
Algorithm HTML
Overview
-
Search by tag name in double quotes, e.g.
"br"
. -
The sequence of tags is formed by a delimiter
|
, for example"html"|"head"|"title"
. -
Getting one of the same tags is done by adding an index after the tag delimiter (starting with zero), e.g.
"html"|"br"|1|"title"
. -
By default, the transition to searching for the next tag occurs with the selection of the null tag.
-
Request
"html"|0|"head"|0|"title"|0
equivalent to a request"html"|"head"|"title"
, i.e. a query by tag name always returns a list. -
The query can be built by indexes, e.g.
"0|0|1"
. -
Brackets are used to refer to tag attributes.
-
Request
"html"|"head"|("charset")
will give a list of parent tags"head"
that contain the attribute"charset"
. -
Request
"html"|"head"|("type="test/css")
outputs a list of parent tags"head"
in which the"type"
attribute is equal to"test/css"
.
<HTML>
<HEAD>
<META a="1" b="2"/>
</HEAD>
<BODY>
<p id="x1" class="abc">abc abc
<a href="http://asdf.ru">link</a> <br>
</p>
<br><br>
<p id="x2" class="abc" v="123">zxcv zxcv</p>
</BODY>
</HTML>
Search Query | Function | Result |
---|---|---|
|
|
<p id="x1" class="abc">abc abc <a href="http://asdf.ru">link</a> <br></p> . |
|
abc abc <a href="http://asdf.ru">link</a> <br> . |
|
|
|
|
|
|
|
|
|
|
|
|
<p id="x1" class="abc">abc abc <a href="http://asdf.ru">link</a> <br></p> . |
|
|
<p id="x1" class="abc">abc abc <a href="http://asdf.ru">link</a> <br></p> . |
|
|
<p id="x2" class="abc" v="123">zxcv zxcv</p> . |
|
|
|
See also
-
role svc