+ Reply to Thread
Results 1 to 5 of 5

How use VBA to auto extract email address from HTML page?

  1. #1
    Registered User
    Join Date
    10-09-2012
    Location
    Denver
    MS-Off Ver
    Excel 2007,2010
    Posts
    3

    How use VBA to auto extract email address from HTML page?

    I have used Doc.getElementById("ID").innerText to extract emails from some webpages. But I have a trouble in the following webpage, in which there is no Tag name or ID name for the email link. I could not use VBA to find and extract it. Anyone can give a help?

    http://www.sciencedirect.com/science...92867412010008

    (I need the email address in the button of the little green envelop. The source is "<a href="mailto:t.sixma@nki.nl"><img src="http://cdn.els-cdn.com/sd/entities/REemail.gif" alt="E-mail the corresponding author"></a>")
    Last edited by yuman; 10-11-2012 at 06:57 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: How use VBA to auto extract email address from HTML page?

    Loop through Doc.links looking for href property containing 'mailto:'.
    Post responsibly. Search for excelforum.com

  3. #3
    Registered User
    Join Date
    10-09-2012
    Location
    Denver
    MS-Off Ver
    Excel 2007,2010
    Posts
    3

    Re: How use VBA to auto extract email address from HTML page?

    Quote Originally Posted by Chippy View Post
    Loop through Doc.links looking for href property containing 'mailto:'.
    Thanks! But could you show me the detail to find the 'mailto:'? The following is my code. If the webpage contains two emails, I will insert a row for the second one.

    Please Login or Register  to view this content.
    Last edited by yuman; 10-10-2012 at 02:55 PM.

  4. #4
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: How use VBA to auto extract email address from HTML page?

    Here's one way (untested). This puts all the mailto links into an array - a fixed size array, but I'll let you adapt it as necessary.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-09-2012
    Location
    Denver
    MS-Off Ver
    Excel 2007,2010
    Posts
    3

    Re: How use VBA to auto extract email address from HTML page?

    Thank you! It works to me!

    Quote Originally Posted by Chippy View Post
    Here's one way (untested). This puts all the mailto links into an array - a fixed size array, but I'll let you adapt it as necessary.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1