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 get HTML source of Webpage in C# ?

How to get HTML source of Webpage in C# ?

Scheduled Pinned Locked Moved C#
csharphtmlhelptutorialquestion
3 Posts 2 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.
  • S Offline
    S Offline
    Supriya Tonape
    wrote on last edited by
    #1

    Hi, Can anybody help me out to get the HTML source of webpade in C#? Right now thru below code I am getting the inner code but that is not whole source which I get when I do 'view source' on webpage.... . . . ibrowser = (IWebBrowser2)pDisp; HTMLDocument idoc = (HTMLDocument)ibrowser.Document; innerHTML = idoc.documentElement.innerHTML; ...... plz do reply asap. thanks n regards, Supriya

    RaviBeeR 1 Reply Last reply
    0
    • S Supriya Tonape

      Hi, Can anybody help me out to get the HTML source of webpade in C#? Right now thru below code I am getting the inner code but that is not whole source which I get when I do 'view source' on webpage.... . . . ibrowser = (IWebBrowser2)pDisp; HTMLDocument idoc = (HTMLDocument)ibrowser.Document; innerHTML = idoc.documentElement.innerHTML; ...... plz do reply asap. thanks n regards, Supriya

      RaviBeeR Offline
      RaviBeeR Offline
      RaviBee
      wrote on last edited by
      #2

      One way to get the page's entire content is to use this[^] class. The Content property holds the HTML source. /ravi

      This is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

      S 1 Reply Last reply
      0
      • RaviBeeR RaviBee

        One way to get the page's entire content is to use this[^] class. The Content property holds the HTML source. /ravi

        This is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

        S Offline
        S Offline
        Supriya Tonape
        wrote on last edited by
        #3

        hey that prob got solved actually, thx anyway! Now I want to change the text on webpage, U can say I want to highlight particular word on webpage n display that page again. Now I m doing below thing, . . String str = internalBrowser.Document.Body.InnerText.Replace("MSN","mSn!"); internalBrowser.Document.Body.InnerText = str; ..... but when page is displayed just the text gets displayed n not the exact page or Images n all... I have one more option to parse internalBrowser.Document.Body.InnerHTML n change the word n append tag for highlighting the particular word... is it right or is there any other way???? thx Supriya Tonape

        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