Please note that Sahi's development and support teams do not actively monitor this. This is more a community forum. If you are a Sahi Pro user looking for commercial support, please email support @ sahipro.com with your query.

Reading dynamic content from div containing list

Hello -

I am a beginner to Sahi. I am trying to adopt Sahi for a product that has a digital chat bot assistant.
The html script is as follows:
<div class="Chat_bot_div">
<div class="Chat_bot" id="myDIV">
<div class=“MY_Chat">
<ul tabindex="1" style="overflow: hidden; outline: none; height: 50px;">

<div class="cl"></div>
<li><span>Hello</span></li>
<li class="MY_Chat"><span>Hi. I am Alex, your digital assistant. I can help you with any finance related information you may be looking for.</span></li>
<li class="MY_Chat loader" style="display: none;"><p>typing...</p></li>
</ul>
<div class="cl"></div>
</div>
<div class="text_area">
<textarea name="message" id="chat-input" placeholder="Type a message" required=""></textarea>
<div class="cl"></div>
</div>
</div>
<div class="cl"></div>
</div>

As you could see, if I say Hello, the chat bot says "Hi. I am Alex, your digital assistant....."

Further, if I ask it a question as to what the total balance is and provide a customer name on it's prompt, it provides me with total balance. The new html that gets generated looks like below as I start interacting with it.

<div class="Chat_bot_div">
<div class="Chat_bot" id="myDIV">
<div class=“MY_Chat">
<ul tabindex="1" style="overflow: hidden; outline: none; height: 50px;">

<div class="cl"></div>
<li><span>Hello</span></li>
<li class=“MY_Chat"><span>Hi. I am Alex, your digital finance assistant. I can help you with any finance related information you may be looking for.</span></li>
<li><span>total balance</span></li>
<li class=“MY_Chat"><span>Please give me customer name</span></li>
<li><span>XYZ CORP</span></li>
<li class=“MY_Chat"><span>The total balance of the customer XYZ CORP is $4,621,430.01.</span></li>
<li class=“MY_Chat loader" style="display: none;"><p>typing...</p></li>
</ul>
<div class="cl"></div>
</div>
<div class="text_area">
<textarea name="message" id="chat-input" placeholder="Type a message" required=""></textarea>
<div class="cl"></div>
</div>
</div>
<div class="cl"></div>
</div>

What I am interested is to pull the balance amount shown above in one of the span's under class "MY_Chat" and compare it with DB or compare it with data in another screen.

I am not sure how to achieve this. Can someone help me here?

Regards
-B
Sign In or Register to comment.