You're able to locate (say) a 100 emails in gmail with a search - say "nextdoor west atherton".
Now, you want to (say) grab the name, community name and post-subject for the various posts that are part of this email.
How?
First, check the box on the menu-bar. Then, you'll see a link that you can click on to "Select all conversations that match this search." Click that.
Lastly, click on the three vertical dots and pick "Forward as attachment"
Send it to yourself. Then, view that email, and, you'll see an icon with this tooltip :
Use this to download to your PC.
And then? How do you grep. You have a bunch of .eml files. Look at any of them and you quickly see that the "encoding" has made your life painful :).
That's where automation comes in - namely python scripting :)
You want to process all of these files and dump out the text of the body to see if it's amenable to parsing. This much you can do with this simple script :
This simple file (once you've installed email and BeautifulSoup) will see you through to the text-generation part..
https://github.com/ananthchellappa/python/blob/master/dump_eml_text.py
Comments
Post a Comment