How to extract the data from the HTML Gmail Body

Hello, I need to extract the Particular data from the Gmail Html Body I tried like
item.Headers(“HTMLBody”).ToString

I get the data like this
bodymail.txt (27.6 KB)

how can we extract this I am thinking to use regex but how?
bellow image you are seeing right This message is in HTML I upload the file above bodymail.txt
image

How to extract the above HTML body I need Inside of the body
[dont…you. register now…enterprise] up to hear I need :point_down:
image

I hope I will get the solution for this.

Thanks
Chethan P

Hi @copy_writes !
I you try with item.Body.tostring does it get what you are looking for ? Do you confirm that item is of type System.Net.Mail.MailMessage ?

for HTML body

it wont work

Yes

Hi @copy_writes

one way you can try is

  1. Save the body.txt data in file named as body.html with html file

Now open the html file using open browser and then use get text to extract the data

Try that logic

Regards,
Nived N
Happy Automation

2 Likes

:clap: :clap: :clap: :clap: :clap: :pray:genius thank you please support like this.

Thanks
Chethan P

1 Like

Now open the html file using open browser and then use get text to extract the data

This logic is not working I use get text the selector is not working and the value is null

Did the selector is indicating the part ?

No :expressionless: I check for other website pages it’s working

if i use explore application its working and get extract is also working if i use get text in chrome its not working but get text ocr is working in chrome but open browser is not working

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.