faridmd
(Faridmd)
October 4, 2023, 3:16am
1
Temperature.txt (9.8 KB)
Hi i have created a flow to extract the InnerHTML. So now i need to extract the temperature (BOLD ) base on the location .For example. I thought of using regex. but nit sure of the pattern.
class=‘list-unstyled’>
Location: Changi Heat stress level: Low WBGT (℃): 29.0 Air temperature: 29.5℃ " data-original-title=“” title=“” onclick=“showByClickSpan(‘S124’)” style=“display: block; top: 167.171px; left: 707.501px;” class=“sgr points icon shadow low” data-UiPath_custom_id_23_10_66_33458=“13”>
<span id=“S125” data-toggle=“popover” data-placement=“top” data-trigger=“hover” data-content="
Location: Woodlands Stadium Heat stress level: Low WBGT (℃): 29.7
thank you
1 Like
Welcome @faridmd to the UiPath Community Forums
Give these patterns a try:
Location
Heat stess level
WBGT
Cheers
Steve
Yoichi
(Yoichi)
October 4, 2023, 3:36am
4
Hi,
Can you try the following sample?
mc = System.Text.RegularExpressions.Regex.Matches(strText,"Location:(\s*\<[^<]+\>)+(?<LOCATION>[^<]+)(\s*\<[^<]+\>)+Heat stress level:(\s*\<[^>]+\>)+(?<HSL>[^<]+)(\s*\<[^>]+\>)+WBGT\s*\([^)]+\): (?<WBGT>[\d.,]+)")
Sample
Sample20231004-3L.zip (4.5 KB)
Regards,
1 Like
faridmd
(Faridmd)
October 4, 2023, 5:44am
5
Yoichi:
System.Text.RegularExpressions.Regex.Matches(strText,"Location:(\s*\<[^<]+\>)+(?<LOCATION>[^<]+)(\s*\<[^<]+\>)+Heat stress level:(\s*\<[^>]+\>)+(?<HSL>[^<]+)(\s*\<[^>]+\>)+WBGT\s*\([^)]+\): (?<WBGT>[\d.,]+)")
Hello Yoichi,
Awesome. It works wonderfully. Thank you for your help. Theres more to learn for me… cheers.
1 Like
system
(system)
Closed
October 7, 2023, 5:44am
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.