I am using temporary emails for my selenium project but I've been stuck on this issue for some time. The information always seems to be changing and I cannot figure out how I'm supposed to write it. This is the HTML:
<a href="https://temp-mail.org/en/view/cd89ea25d93a2fed0d182d9d8225b5b" title="" class="viewLink title-subject" data-mail-id="cd89ea25d93a2fed0d182d9d82425b5b">812479 is your Instagram code</a>
I've tried to find the mail-id using various methods that I've read about.
execute = browser.find_element_by_xpath('.//span[@class = "data-mail-id"]') #Attempt 1
execute = browser.find_element_by_xpath('//span[text()="Instagram"]')
I've even copied the full xpath but it always returns Unable to Locate Element
However, the data-mail-id
and the code changes every time you send an email to your inbox. What do I need to change?
I want the string ("812479"
) that's followed by " is your Instagram code"
.