May-03-2018, 05:03 AM
(This post was last modified: May-03-2018, 06:16 AM by Prince_Bhatia.)
Hi,
I receive the certain outlook email on daily basis which looks like a table with the subject : Creation Report - 30/04/2018(these dates change daily)
so far i tried this :
since body is case sensitive, i cant show it but it is a table.
can anyone please help?
I receive the certain outlook email on daily basis which looks like a table with the subject : Creation Report - 30/04/2018(these dates change daily)
so far i tried this :
import win32com.client
import os
outlook=win32com.client.Dispatch("Outlook.Application").GetNameSpace("MAPI")
inbox=outlook.GetDefaultFolder(6) #Inbox default index value is 6
message=inbox.Items
message2=message.GetLast()
subject=message2.Subject("XID Creation Report")
body=message2.body
date=message2.senton.date()
sender=message2.Sender
attachments=message2.Attachments
print(subject)
print(body)
print(sender)
print(attachments.count)
print(date)Since i dont have much experience in outlook scraping , how can i scrape this subject email from outlook and save it into excelsince body is case sensitive, i cant show it but it is a table.
can anyone please help?
