S
S
Stepan2020-05-27 22:38:39
Parsing
Stepan, 2020-05-27 22:38:39

How to get 2 pieces of XPATH text?

How do I get the time if the text in a certain class is equal to Telegram?

<li class="im_dialog_wrap active" my-dialog="" dialog-message="dialogMessage" ng-repeat="dialogMessage in dialogs track by dialogMessage.peerID" ng-class="{active: curDialog.peerID == dialogMessage.peerID}" style=""><a class="im_dialog" ng-mousedown="dialogSelect(dialogMessage.peerString, dialogMessage.unreadCount == -1 &amp;&amp; dialogMessage.mid)">

  <div class="im_dialog_meta pull-right text-right">
    <div class="im_dialog_date" ng-bind="dialogMessage.dateText">10:07 PM</div>
  </div>

    <div class="im_dialog_peer">
      <span my-peer-link="dialogMessage.peerID" verified="true" for-dialog="!dialogMessage.foundInHistory">Telegram <i class="icon-verified"></i></span>
    </div>

    
</li>


That is, if the im_dialog_peer contains the Telegram text , then you need to take the time from the external element im_dialog_date . I was stuck on how to find the Time in the element with the im_dialog_wrap class.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2020-05-27
@Stepashka20

more or less like this

//div[@class="im_dialog_peer"]/span[normalize-space(text()) = 'Telegram']/../..//div[@class="im_dialog_date"]/text()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question