Extract data from the body of the mails

Greetings of the day…
hai I am having a task related to same risk management.
I need to extract the name id and rating from this form.
I may get many emails from supplier with subject as Risk Assessment. So I need to open all the emails that have the subject and scrap the data and save it in an excel. I used click activity to open the mail and used full-text activity to scrap the data. But it gives me only the information of the first mail but it gives me as many as unread messages. For example, if i have 2 unread messages it extracts two times but only the first mail. How can I achieve to extract all the emails that I had received?
1

Hi @soumi_soumiya,
Please don’t create two similar topics about the same.

Regarding your case. Why instead of click you will not use email related activities like IMAP, Outlook etc?


Then you could loop it through each email. I think this is the easiest way to achieve what you need.

sorry cant get you can u be more clear

I mean something like this:
image

Thanks for your reply
It returns me only content in body but I need to open the mail and scrap the data such as supplier name and the average score.
1

@soumi_soumiya so you can give like this it might work item.body.contains(“supplier Name”) if the body contains supplier name it goes to then section there use get text activity and indicate the name of the person and store it in a variable

Hmmm for scraping data you could place inside the loop that for each item it should open the mail and based on item.Subject scrape data.

1 Like

I had given in for each activity
for
But still, it read only the first mail

Thanks for your reply
1
This is the file that I have in my mail and how come can I give a body condition

@soumi_soumiya in that body can you able to identify individual element by using get text activity

Thanks for your reply…
Yes i am able to scrap the data from that form. But it gives me only the information of first mail. Think so some problem in click activity but i am not able to solve it

@soumi_soumiya make sure the selectors which you are using are static or dynamic.

I am changing it to dynamic using *

@soumi_soumiya which activities did you use to get data for the first mail body.

As it is an image we used get full text activity. extracting of data is not a problem, click activity is only selecting the first mail what to do to select all the mail that matches with subject

@soumi_soumiya i don’t why you use click activity to click on mail.as you know get outlook/imap will read all the unread mails by choosing in properties panel.so in for each use if condition like **item.subject.contains(“value you are looking for”)**if it finds ant mail with that subject it goes to then section there use get full text activity.i think this will work right.

@soumi_soumiya As mentioned by @Pablito to use mail activities once you get the mail object you can get the entire body and do string manipulation to fetch whatever data you require, i think your body contains an html table then it should read them as well, if you still don’t want to use this approach you can save your email in ".mht: format and open it with IE to do data scrapping and get data what ever you required in a table itself. Example :

1 Like

Thanks for your reply…
If i fail to use the click activity bot is not able to select

@soumi_soumiya can i have a look of click activity selector.

Thanks for your reply…
This is what I get but I change the last line completely dynamic by replacing all
values with *