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. saving a rendered web page

saving a rendered web page

Scheduled Pinned Locked Moved C#
csharpjavascripthelpquestion
6 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.
  • M Offline
    M Offline
    manustone
    wrote on last edited by
    #1

    Hi All I need to develop a C# client able to save a web page given a URL. The problem I am is that the web pages i.e. the content are rendered by some javascript. Can you advise me about an easy way to do that? Thanks

    N 1 Reply Last reply
    0
    • M manustone

      Hi All I need to develop a C# client able to save a web page given a URL. The problem I am is that the web pages i.e. the content are rendered by some javascript. Can you advise me about an easy way to do that? Thanks

      N Offline
      N Offline
      Nicholas Butler
      wrote on last edited by
      #2

      You don't say in what format you want to 'save' the page. You may be able to render the page using a System.Windows.Forms.WebBrowser control and use that. Nick

      ---------------------------------- Be excellent to each other :)

      M 2 Replies Last reply
      0
      • N Nicholas Butler

        You don't say in what format you want to 'save' the page. You may be able to render the page using a System.Windows.Forms.WebBrowser control and use that. Nick

        ---------------------------------- Be excellent to each other :)

        M Offline
        M Offline
        manustone
        wrote on last edited by
        #3

        My Page renders a simple HTML table generated automatically by some javascript. I would like to save the rendered page in HTML format so that I can parse it or reload it later.

        N 1 Reply Last reply
        0
        • N Nicholas Butler

          You don't say in what format you want to 'save' the page. You may be able to render the page using a System.Windows.Forms.WebBrowser control and use that. Nick

          ---------------------------------- Be excellent to each other :)

          M Offline
          M Offline
          manustone
          wrote on last edited by
          #4

          Probably I found what I need to do. I have to download something called DOM information. For my purpose it would be enough. Do you know how to do that in C# after a web page was loaded?

          1 Reply Last reply
          0
          • M manustone

            My Page renders a simple HTML table generated automatically by some javascript. I would like to save the rendered page in HTML format so that I can parse it or reload it later.

            N Offline
            N Offline
            Nicholas Butler
            wrote on last edited by
            #5

            Basically, you want a javascript interpreter. Caveat: I haven't tried this, but I would if I were you :) Create a WebBrowser control and give it your [ template HTML / javascript ] using DocumentText. Hook the DocumentComplete event and see what is in the Document property. I know the WebBrowser control knows how to run javascript, so that's a start. If you do try this, please let me know if it works - I'm interested :) Nick

            ---------------------------------- Be excellent to each other :)

            M 1 Reply Last reply
            0
            • N Nicholas Butler

              Basically, you want a javascript interpreter. Caveat: I haven't tried this, but I would if I were you :) Create a WebBrowser control and give it your [ template HTML / javascript ] using DocumentText. Hook the DocumentComplete event and see what is in the Document property. I know the WebBrowser control knows how to run javascript, so that's a start. If you do try this, please let me know if it works - I'm interested :) Nick

              ---------------------------------- Be excellent to each other :)

              M Offline
              M Offline
              manustone
              wrote on last edited by
              #6

              Well I have just found what I need for my specific purposes; I hope that it fits also yours. Please have a look at this project The most complete C# Webbrowser wrapper control[^] Digging and trying I found that this project provides DOM information and is exactly what I need. I found that you need an active x for accomplish this handling the IHTMLDocument2 class. PLease look also here column_1[^] and here column_2[^]

              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