Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

...

...

...

...

...

...

...

...

...

...

Panel
panelIconIdatlassian-info
panelIcon:info:
bgColor#E3FCEF

Please read the Terms of Use for Materials on ZennoLab

Table of contents

Expand
titleClick here to expand the table of contents
Table of Contents
minLevel1
maxLevel7
exclude^Оглавление$

...

...

How to open a window?

The button to enable this window is located to the right of the address bar of the browser.

...

When you click on this button, the regular expression tester will be run, and the contents of the window will be automatically copied into it.

...

Let's say you need to parse <meta> tags with a property attribute from the topic page on the ZennoLab forum . You can't get to them through the action designer . these tags are not displayed in any way. Our actions:

  • Go to the required page

  • We run the code view window (in this case, you can use both the DOM and the source code, this will not affect the final result in any way) and look at the necessary tags (there are several of them, but only one will be given here):

    All tags have the same structure: they always start with <meta property = and end with

    > in quotes, immediately after property, the name of this property, and in the content attribute - the content.

  • Copy the content into the regular expression tester using the button of the same name. Based on the analysis from the previous step, create a regular line - (?<=<meta\ property=)"([a-z:]+)"\s+content="(.*?)"(?=>)

  • With an action Text processing and its Regex actions, we get the values we need from the page code and save them to the table:

...

  • {-Page.Dom-} - this variable stores the DOM of the tab. For source code, this is{-Page.Source-},for text- {-Page.Text-}. You can find others in the variables window .

  • Why was column zero been excluded? Bracket group was used in the regular expression ((?<=<meta\ property=)"([a-z:]+)"\s+content="(.*?)"(?=>) - two groups are highlighted in red). When testing in the regular expression tester, going to the Groups tab , you will notice that three groups were found, despite the fact that we have two of them: the very first group contains the full match text, and then the groups that have been defined follow. And since the numbering starts from zero, we exclude exactly the column with the number 0, not 1.

...