Abhay Bh
Abhay Bh

Reputation: 132

Workfusion: How to click all hyperlinks within an email, except those links after 'Thanks'?

I want to click on all links which are present in an email, except those which are not the actual part of the email.

I want to do this by using a loop or something. Eg. If there are 3 links, then traverse For loop 3 times, click on each hyperlink and do something.

How do I do that?

Upvotes: 0

Views: 91

Answers (1)

Marek Stejskal
Marek Stejskal

Reputation: 2708

The steps you need to follow are these:

  1. Get mail HTML body
  2. Convert HTML to XML
  3. Perform XPath to find your links

It can look something like this:

<xpath expression="//a[following::*[contains(text(),'Thanks')]]">
    <html-to-xml>
        <!-- your e-mail HTML body -->
    </html-to-xml>
</xpath>

Upvotes: 2

Related Questions