Mailto links are used to redirect to an email address instead of a web page URL. When a user clicks on the Mailto link, the default email client on the visitor's computer opens and suggests sending a message to the email address mentioned in the Mailto link.

If a website contains “mailto” links, it is possible to scrape email addresses from it regardless of the website structure.

A standard “mailto” link looks like this in the HTML source code:

<a href="mailto:email@example.com">Send Email</a>
<a href="mailto:email@example.com, secondemail@example.com">Send Email</a>

So the XPath below may work wonders in some cases:

//a[contains(@href,'mailto')]

Note: the above instruction only applies to “mailto” hyperlinks like this:

email_address_able_to_be_extracted.jpg
Did this answer your question?