Python Forum

Full Version: is it possible to copy image from email and place into excel file?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So we have a daily email from 3rd party that has a statistics graph embedded in the body of the mail we receive. We have a daily dashboard that we display around the office with this chart/graph and right now we manually copy from the email, paste it into the excel file, resize a little to fit within a given frame size so it displays completely on the screens around the office..

Id like to see if its possible to handle this manual task using python... I already use python to download attachments from my outlook and update spreadsheets with that data, just curious if its possible to do this with python.

if so what should i consider or look up in order to grab the image/screenshot from a given email and paste into a specific area in the excel file.
(Nov-29-2022, 04:03 PM)cubangt Wrote: [ -> ]if so what should i consider or look up in order to grab the image/screenshot from a given email and paste into a specific area in the excel file.
Could use Selenium to take screenshot and can also drop Excel and use Colab give all the url as i do now.
Example take screenshot of your post, and Notebook to display the image.
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_argument("--headless")
options.add_argument("window-size=800,550")
browser = webdriver.Chrome(executable_path=r'C:\cmder\bin\chromedriver.exe', options=options)
browser.get('https://python-forum.io/thread-38834.html')
browser.save_screenshot("image.png")
browser.close()
How would that work if the screenshot / image i need to get is in an outlook email we receive daily.
I thought selenium was only for web page/content online?
(Nov-30-2022, 04:06 PM)cubangt Wrote: [ -> ]How would that work if the screenshot / image i need to get is in an outlook email we receive daily.
I thought selenium was only for web page/content online?
Yes,for outlook have to look at something like extract-msg, independentsoft.msg.