Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to extract HTML code From any webpage using C#.Net

How to extract HTML code From any webpage using C#.Net

Scheduled Pinned Locked Moved C#
csharphtmlcomtutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    allivelu
    wrote on last edited by
    #1

    How to extract html code any web site using C#.Net I mean : http://www.yahoo.com----in that site find the Urls,Emailid,phone Pls give code Reddy

    C M 2 Replies Last reply
    0
    • A allivelu

      How to extract html code any web site using C#.Net I mean : http://www.yahoo.com----in that site find the Urls,Emailid,phone Pls give code Reddy

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Grabbing the HTML is easy, the rest probably involves regular expressions to parse the string that contains the page.

      Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      1 Reply Last reply
      0
      • A allivelu

        How to extract html code any web site using C#.Net I mean : http://www.yahoo.com----in that site find the Urls,Emailid,phone Pls give code Reddy

        M Offline
        M Offline
        Matthew Cuba
        wrote on last edited by
        #3

        allivelu wrote:

        How to extract html code any web site using C#.Net I mean : http://www.yahoo.com----in that site find the Urls,Emailid,phone

        I'm not sure exactly what you want. If you are looking to get the HTML for a webpage, load it in a WebBrowser object and use the DocumentText property to retrieve the HTML as a string. If you are looking for the URLs, email, and phone numbers, you'll need to look at the string you got from calling browser.DocumentText for substrings that match the pattern of a URL, email address or phone number. The Regex class is what you might want to look at, since that is *really* helpful at doing pattern matching. Good Luck!

        It isn't enough to do well in life. One must do good when and where one can. Otherwise, what's the point?

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups