Question & Answer
Question
How do you extract multiple occurrences of the same string pattern on a single page?
Answer
Contents
Question
How do you extract multiple occurrences of the same string pattern on a single page?
Answer
Question
How do you extract multiple occurrences of the same string pattern on a single page?
Answer
The idea is to extract all the error messages defined below:
<ul class="error">
<li class="title">Error</li>
<li><label class="error" style="display:block;">Message 1</label></li>
<li><label class="error" style="display:block;">Message 2</label></li>
<li><label class="error" style="display:block;">Message 3</label></li>
<li><label class="error" style="display:block;">Message 4</label></li>
<li><label class="error" style="display:block;">Message 5</label></li>
</ul>
You define the following Data Parser configuration to capture the error messages:
<li class="title">Error</li>
<li><label class="error" style="display:block;">Message 1</label></li>
<li><label class="error" style="display:block;">Message 2</label></li>
<li><label class="error" style="display:block;">Message 3</label></li>
<li><label class="error" style="display:block;">Message 4</label></li>
<li><label class="error" style="display:block;">Message 5</label></li>
</ul>
You define the following Data Parser configuration to capture the error messages:
[Rule4]
Enabled=True
Actions=ErrorMessage
[ErrorMessage]
Action=Search
SearchType=SinglePass
DisplayName=ErrorMessage
SearchString=<li><label class="error" style="display:block;">
EndTag=</label></li>
MD5=False
The resulting request buffer is illustrated as:
Action=Search
SearchType=SinglePass
DisplayName=ErrorMessage
SearchString=<li><label class="error" style="display:block;">
EndTag=</label></li>
MD5=False
The resulting request buffer is illustrated as:
[appdata]
ErrorMessage=Message 1
ErrorMessage2=Message 2
ErrorMessage3=Message 3
ErrorMessage4=Message 4
ErrorMessage5=Message 5
Article Reference
00001001
Applies to version(s): 7.x
"
[{"Business Unit":{"code":"BU055","label":"Cognitive Applications"},"Product":{"code":"SSERNK","label":"Tealeaf Customer Experience"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"","label":""}}]
Was this topic helpful?
Document Information
Modified date:
08 December 2018
UID
ibm10777531