Copy a Certain Field to the Clipboard from an Email in Gmail – Using Google Chrome

I always get customers email which I would have to manually select and copy with the mouse which is very repetitive and would love to let the KM do this for me. Which looks like above. I tried to select the field with KM but it fails to find it (sends me failed to find field notification)

The XPath for the email field is: //*[@id=":2b1"]/div[1]/table/tbody/tr/td/table/tbody/tr[2]/td/table/tbody/tr/td/p[5]/a

The second step I am still not sure is how do I tell KM to copy email address once it finds it.

Please advice

Your image does not look like an image from Gmail. In fact, it even says "Powered by Shoppy". Is it actually a web site, not Gmail?

If so, then we will need either the URL for an example page, or the HTML code of a large block around the target field, or even better, the entire web page. Post as a Code Block, using "html" as the language.

Sorry about that, its actually an email from shoppy store website that contains the customer's email, that is what I would like to copy.

Here is the part of HTML code if I paste whole HTML code it will crash the broswer:

--- <td class="m_-1441119749352586247body" width="100%" cellpadding="0" cellspacing="0" style="font-family:-apple-system,BlinkMacSystemFont,Proxima Nova,Helvetica Neue,Segoe UI,Roboto,Oxygen,Fira Sans,Droid Sans,sans-serif;box-sizing:border-box;background-color:#ffffff;margin:0;padding:15px 40px 30px;line-height:190%;width:100%;color:#505050;font-size:15px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">
                            <table class="m_-1441119749352586247inner-body" align="center" cellpadding="0" cellspacing="0" style="font-family:-apple-system,BlinkMacSystemFont,Proxima Nova,Helvetica Neue,Segoe UI,Roboto,Oxygen,Fira Sans,Droid Sans,sans-serif;box-sizing:border-box;background-color:#ffffff;margin:0 auto;padding:0;width:480px">
<tbody><tr>
<td class="m_-1441119749352586247content-cell" style="font-family:-apple-system,BlinkMacSystemFont,Proxima Nova,Helvetica Neue,Segoe UI,Roboto,Oxygen,Fira Sans,Droid Sans,sans-serif;box-sizing:border-box">
                                        <p style="font-family:-apple-system,BlinkMacSystemFont,Proxima Nova,Helvetica Neue,Segoe UI,Roboto,Oxygen,Fira Sans,Droid Sans,sans-serif;box-sizing:border-box;color:#505050;font-size:14px;line-height:1.5em;margin-top:0;text-align:left">You have made a sale on Shoppy. The details for said invoice can be found below.</p>
<p style="font-family:-apple-system,BlinkMacSystemFont,Proxima Nova,Helvetica Neue,Segoe UI,Roboto,Oxygen,Fira Sans,Droid Sans,sans-serif;box-sizing:border-box;color:#505050;font-size:14px;line-height:1.5em;margin-top:0;text-align:left"><br></p>
<div class="m_-1441119749352586247table-w100" style="font-family:-apple-system,BlinkMacSystemFont,Proxima Nova,Helvetica Neue,Segoe UI,Roboto,Oxygen,Fira Sans,Droid Sans,sans-serif;box-sizing:border-box">
    <table style="font-family:-apple-system,BlinkMacSystemFont,Proxima Nova,Helvetica Neue,Segoe UI,Roboto,Oxygen,Fira Sans,Droid Sans,sans-serif;box-sizing:border-box;width:100%;text-align:left;margin-bottom:30px">
<thead style="font-family:-apple-system,BlinkMacSystemFont,Proxima Nova,Helvetica Neue,Segoe UI,Roboto,Oxygen,Fira Sans,Droid Sans,sans-serif;box-sizing:border-box"><tr>
<th style="font-family:-apple-system,BlinkMacSystemFont,Proxima Nova,Helvetica Neue,Segoe UI,Roboto,Oxygen,Fira Sans,Droid Sans,sans-serif;box-sizing:border-box;color:#657c96;text-transform:uppercase;font-size:11px;letter-spacing:1.1px;font-weight:bold;line-height:1">Amount</th>
<th style="font-family:-apple-system,BlinkMacSystemFont,Proxima Nova,Helvetica Neue,Segoe UI,Roboto,Oxygen,Fira Sans,Droid Sans,sans-serif;box-sizing:border-box;color:#657c96;text-transform:uppercase;font-size:11px;letter-spacing:1.1px;font-weight:bold;line-height:1">Gateway</th>
<th style="font-family:-apple-system,BlinkMacSystemFont,Proxima Nova,Helvetica Neue,Segoe UI,Roboto,Oxygen,Fira Sans,Droid Sans,sans-serif;box-sizing:border-box;color:#657c96;text-transform:uppercase;font-size:11px;letter-spacing:1.1px;font-weight:bold;line-height:1">Date sold</th>
</tr></thead>
<tbody style="font-family:-apple-system,BlinkMacSystemFont,Proxima Nova,Helvetica Neue,Segoe UI,Roboto,Oxygen,Fira Sans,Droid Sans,sans-serif;box-sizing:border-box"><tr>
<td style="font-family:-apple-system,BlinkMacSystemFont,Proxima Nova,Helvetica Neue,Segoe UI,Roboto,Oxygen,Fira Sans,Droid Sans,sans-serif;box-sizing:border-box;width:33%">US$4.99</td>
<td style="font-family:-apple-system,BlinkMacSystemFont,Proxima Nova,Helvetica Neue,Segoe UI,Roboto,Oxygen,Fira Sans,Droid Sans,sans-serif;box-sizing:border-box;width:33%">PayPal</td>
<td style="font-family:-apple-system,BlinkMacSystemFont,Proxima Nova,Helvetica Neue,Segoe UI,Roboto,Oxygen,Fira Sans,Droid Sans,sans-serif;box-sizing:border-box;width:33%">September 03, 2019</td>
</tr></tbody>
</table>
</div>
<h2 style="font-family:-apple-system,BlinkMacSystemFont,Proxima Nova,Helvetica Neue,Segoe UI,Roboto,Oxygen,Fira Sans,Droid Sans,sans-serif;box-sizing:border-box;color:#657c96;margin-top:30px;text-align:left;text-transform:uppercase;font-size:11px;letter-spacing:1.1px;font-weight:bold;line-height:1">Product</h2>
<p style="font-family:-apple-system,BlinkMacSystemFont,Proxima Nova,Helvetica Neue,Segoe UI,Roboto,Oxygen,Fira Sans,Droid Sans,sans-serif;box-sizing:border-box;color:#505050;font-size:14px;line-height:1.5em;margin-top:0;text-align:left"><a href="https://shoppy.gg/product/u8Ik6Lw" style="font-family:-apple-system,BlinkMacSystemFont,Proxima Nova,Helvetica Neue,Segoe UI,Roboto,Oxygen,Fira Sans,Droid Sans,sans-serif;box-sizing:border-box;color:#3869d4;text-decoration:none" target="_blank" data-saferedirecturl="https://www.google.com/url?q=https://shoppy.gg/product/u8Ik6Lw&amp;source=gmail&amp;ust=1567619381326000&amp;usg=AFQjCNEn5NWF3I9yJHtNQ_0_0H-JNE8m7g">EDU Email Address | Instantly send ✔ Google Drive Unlimited + ✔ Amazon Prime Student + ✔ Office 365  + MORE</a></p>
<h2 style="font-family:-apple-system,BlinkMacSystemFont,Proxima Nova,Helvetica Neue,Segoe UI,Roboto,Oxygen,Fira Sans,Droid Sans,sans-serif;box-sizing:border-box;color:#657c96;margin-top:30px;text-align:left;text-transform:uppercase;font-size:11px;letter-spacing:1.1px;font-weight:bold;line-height:1">Order ID</h2>
<p style="font-family:-apple-system,BlinkMacSystemFont,Proxima Nova,Helvetica Neue,Segoe UI,Roboto,Oxygen,Fira Sans,Droid Sans,sans-serif;box-sizing:border-box;color:#505050;font-size:14px;line-height:1.5em;margin-top:0;text-align:left">843c63e3-8b5f-4410-857f-<wbr>11024eddbb59</p>
<h2 style="font-family:-apple-system,BlinkMacSystemFont,Proxima Nova,Helvetica Neue,Segoe UI,Roboto,Oxygen,Fira Sans,Droid Sans,sans-serif;box-sizing:border-box;color:#657c96;margin-top:30px;text-align:left;text-transform:uppercase;font-size:11px;letter-spacing:1.1px;font-weight:bold;line-height:1">Buyer Email</h2>
<p style="font-family:-apple-system,BlinkMacSystemFont,Proxima Nova,Helvetica Neue,Segoe UI,Roboto,Oxygen,Fira Sans,Droid Sans,sans-serif;box-sizing:border-box;color:#505050;font-size:14px;line-height:1.5em;margin-top:0;text-align:left"><a href="mailto:mysweepstakes19@gmail.com" target="_blank">mysweepstakes19@gmail.com</a></p>

                                        
                                    </td>
                                </tr>
</tbody></table>
</td>


Hey Abbas,

This seems a bit sloppy, but it works with the code you posted.

Run with an Execute a JavaScript in Front Browser action:

document.querySelector('p > a[href*="mailto"]').href

This has a bit more focus but will be that much more fragile because of it:

document.querySelector('p:nth-child(9) > a').href

@JMichaelTX may come up with something better, but this gives you something to chew on in the meantime.

-Chris