Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8155647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:43:43+00:00 2026-06-06T16:43:43+00:00

I have been trying to extract an e-mail address from a website using XPath.

  • 0

I have been trying to extract an e-mail address from a website using XPath. There is only 1 email address on the entire page. Is there an easy way to reference that one e-mail address using XPath?

something like: //a/contains(@href,'@')

I tried something similar to what I have posted above with no success, I’d appreciate any advice on a reliable way to pull e-mail address using Xpath. Assume there is only 1 e-mail address on the page with no identifying information other than a simple <a href="mailto:example@george.com"> tag.

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T16:43:45+00:00Added an answer on June 6, 2026 at 4:43 pm
    //a[contains(text(), "@")]
    

    That will return you the node containing the e-mail address (well, an @ sign at least), not the e-mail address itself.

    If you can be sure the node contains only the e-mail address and no other adjacent text, you can get it with

    //a[contains(text(), "@")]/text()
    

    If you can’t be sure, you’d have to string-handle it out of the text manually. This is going to be pretty painful in XPath 1.0 since, depending on your implementation, you probably don’t have access to any REGEX functionality.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to extract e-mail addresses from the following code for quite
I have been using XPath with scrapy to extract text from html tags online,
I have been trying to extract data from a database and fill in a
I have been trying to extract hours, seconds and minutes from an input text
I have been attacking atoi from several different angles trying to extract ints from
I have been going round in circles trying to extract meta tag information from
I have been trying to create a ListView which I can sort using drag
I have been trying to align an entire label along with text to the
I have been trying to put together something that allows me to extract points
i have tried several methods of trying to extract values from an XML file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.