0

I'm trying to automate Outlook webmail app, to check my email account and start looking for emails with special words in the subject and brings them to inbox or other and maybe reply. I have already made a code that does the same thing with Gmail, but it's easier with the Gmail HTML version. but with owa I can't locate items. any ideas to try?

I tried Xpath and CSS selector and looking inside iframes

driver.find_element_by_xpath("""//span[@title='Junk Email']""").click()

It should find the element and click it but It returns with NoSuchElementException.

MT-FreeHK
  • 2,462
  • 1
  • 13
  • 29
  • You should use " driver.switch_to_frame('iframe_id')", For more information follow this link "https://chercher.tech/python/iframe-selenium-python" – Rajat Jun 24 '19 at 05:26
  • 1
    Provide the HTML code – cruisepandey Jun 24 '19 at 05:29
  • 1
    @Rajat : NoSuchElementException can be thrown either when element is in frame or locator isn't correct or may be web driver isn't able to locate element, but it can't just be frame thing. – cruisepandey Jun 24 '19 at 05:31
  • FWIW, API seems more suitable: https://learn.microsoft.com/en-us/previous-versions/office/office-365-api/api/version-2.0/mail-rest-operations – orde Jun 24 '19 at 06:30

0 Answers0