0

My business has hundreds of incoming emails daily and my plan was to have the sorting and answering at least partly automated. I know that using JavaScript it would be possible to select those elements on the webpage (i.e. in my inbox) that are email tabs but, as far as I'm concerned, I can't implement cursor movement and clicking in JavaScript to open up the emails one-by-one and copy-paste their contents into a separate file. I want to collect and analyze the texts from incoming emails, classify them based on topics using a large set of keywords, and, once the grouping is finished, assign sample answers to these messages that only have to be proofread and then can be sent out.

My idea was to use Python because it is quite convenient to move the cursor in Python. However, I can't seem to figure out how can I analyze information that is currently on the screen, so that the program can "see" if there are any new emails. In JavaScript this seemed easier, I don't know if it is even possible using Python though.

I am using Windows.

Am I on the right track? Or totally wrong? Maybe I should consider another programming language? Thank you for your insights in advance.

lazarea
  • 1,129
  • 14
  • 43
  • This will get you started https://stackoverflow.com/q/4908472/503835 – eNc Jun 13 '20 at 15:03
  • Maybe scraping is not the best solution. Creating an IMAP-client using [node-imap](https://www.npmjs.com/package/node-imap) may be more convenient. – KooiInc Jun 13 '20 at 15:06

1 Answers1

1

As far as i understand you need to automate the functionality of collecting information in emails to a separate file for further processing. For this I think you can use Selenium Web automation tool (Python) . It is normally used for web site testing. But can be used in use cases like you mentioned. Hope this helps.

https://selenium-python.readthedocs.io/

https://pypi.org/project/selenium/

  • Hi Dilan, unfortunately Selenium doesn't allow me to sign in to Gmail, that first step is not possible, everything afterwards would indeed be an easy process. :( – lazarea Jun 15 '20 at 09:50