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. download webpage Complete

download webpage Complete

Scheduled Pinned Locked Moved C#
questionhelp
10 Posts 4 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.
  • U Offline
    U Offline
    User 9427106
    wrote on last edited by
    #1

    Hi How can i download all content of this page : http://tehran.divar.ir/browse/ I think this is full ajax Cause when u scroll down the page it reload the new data! Please Help?

    L Kornfeld Eliyahu PeterK U 4 Replies Last reply
    0
    • U User 9427106

      Hi How can i download all content of this page : http://tehran.divar.ir/browse/ I think this is full ajax Cause when u scroll down the page it reload the new data! Please Help?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Depending on which browser you are using, you should be able to use the context or main menu to do a Save As operation.

      U 1 Reply Last reply
      0
      • L Lost User

        Depending on which browser you are using, you should be able to use the context or main menu to do a Save As operation.

        U Offline
        U Offline
        User 9427106
        wrote on last edited by
        #3

        thanks for reply! but the page is Compeletly ajax,so i should scroll down and down to reload the info! other website act same as this : http://demos.9lessons.info/load_data_scroll.php[^] i wanna do that in C#! thanks in advanced!

        L 1 Reply Last reply
        0
        • U User 9427106

          thanks for reply! but the page is Compeletly ajax,so i should scroll down and down to reload the info! other website act same as this : http://demos.9lessons.info/load_data_scroll.php[^] i wanna do that in C#! thanks in advanced!

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Sorry, but I'm not sure what your problem is in terms of C#.

          1 Reply Last reply
          0
          • U User 9427106

            Hi How can i download all content of this page : http://tehran.divar.ir/browse/ I think this is full ajax Cause when u scroll down the page it reload the new data! Please Help?

            Kornfeld Eliyahu PeterK Offline
            Kornfeld Eliyahu PeterK Offline
            Kornfeld Eliyahu Peter
            wrote on last edited by
            #5

            Why should you get all the content of someone else's site? It's not yours! You should not touch it!

            I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)

            "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

            U 1 Reply Last reply
            0
            • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

              Why should you get all the content of someone else's site? It's not yours! You should not touch it!

              I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)

              U Offline
              U Offline
              User 9427106
              wrote on last edited by
              #6

              I am doing it for testing and get info of other website for some use!

              1 Reply Last reply
              0
              • U User 9427106

                Hi How can i download all content of this page : http://tehran.divar.ir/browse/ I think this is full ajax Cause when u scroll down the page it reload the new data! Please Help?

                U Offline
                U Offline
                User 9427106
                wrote on last edited by
                #7

                In other words : What's the best way to scrape a web page that has AJAX/dynamic loading of data? For example: scraping a webpage that presents 20 images on load, but when a user scroll down the page it loads more images (sort of like Facebook). In such a case how do you scrape all the images, not just the first 20?

                L 1 Reply Last reply
                0
                • U User 9427106

                  In other words : What's the best way to scrape a web page that has AJAX/dynamic loading of data? For example: scraping a webpage that presents 20 images on load, but when a user scroll down the page it loads more images (sort of like Facebook). In such a case how do you scrape all the images, not just the first 20?

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  Use Fiddler (or something likewise) to see if it makes a specific call to fetch the data. You're looking for anything that gets loaded by the page using JavaScript and that returns some XML/JSON. If that fails, then there's always the WebBrowser control :)

                  Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

                  1 Reply Last reply
                  0
                  • U User 9427106

                    Hi How can i download all content of this page : http://tehran.divar.ir/browse/ I think this is full ajax Cause when u scroll down the page it reload the new data! Please Help?

                    U Offline
                    U Offline
                    User 9427106
                    wrote on last edited by
                    #9

                    I am using this code in ASP.net :

                    <script type="text/javascript">
                    function getDataS() {
                    var dd = '{"jsonrpc":"2.0","method":"getPostList","id":1,"params":[1,[["place2",0,[1,1]]],173099135176724],"hash":"decfe7c9183f16efa1291f5131902f7d4ef4ff14"}';
                    $.ajax({
                    type: "POST",
                    //type: "GET",
                    url: "http://tehran.divar.ir/browse/json/?tm=1407824648578",
                    // url: 'http://tehran.divar.ir/browse/',
                    //url: "http://tehran.divar.ir/",
                    contentType: "application/json; charset=utf-8",
                    // contentType:"application/x-www-form-urlencoded; charset=UTF-8",
                    dataType: "json",
                    async: true,
                    crossDomain: true,
                    data: '{"jsonrpc":"2.0","method":"getPostList","id":1,"params":[1,[["place2",0,[1,1]]],173199866315710],"hash":"13210760e20de99b8218be5cc465851fcb6aa74a"}',
                    //data: "{'jsonrpc':'2.0','method':'getPostList','id':1,'params':[1,[['place2',0,[1,1]]],173099135176724],'hash':'decfe7c9183f16efa1291f5131902f7d4ef4ff14'}",
                    cache: false,
                    processData: false,
                    success: function(msg) {
                    if (msg.d != "")
                    alert('salam');

                                },
                                error: function(xhr, errorType, exception) { //Triggered if an error communicating with server  
                                    var errorMessage = exception || xhr.statusText; //If exception null, then default to xhr.statusText  
                    
                                    alert("There was an error creating your contact: " + errorMessage);
                                }
                            });
                        }
                    

                    </script>

                    I get this error now : There was an error creating your contact: NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://tehran.divar.ir/'.

                    T 1 Reply Last reply
                    0
                    • U User 9427106

                      I am using this code in ASP.net :

                      <script type="text/javascript">
                      function getDataS() {
                      var dd = '{"jsonrpc":"2.0","method":"getPostList","id":1,"params":[1,[["place2",0,[1,1]]],173099135176724],"hash":"decfe7c9183f16efa1291f5131902f7d4ef4ff14"}';
                      $.ajax({
                      type: "POST",
                      //type: "GET",
                      url: "http://tehran.divar.ir/browse/json/?tm=1407824648578",
                      // url: 'http://tehran.divar.ir/browse/',
                      //url: "http://tehran.divar.ir/",
                      contentType: "application/json; charset=utf-8",
                      // contentType:"application/x-www-form-urlencoded; charset=UTF-8",
                      dataType: "json",
                      async: true,
                      crossDomain: true,
                      data: '{"jsonrpc":"2.0","method":"getPostList","id":1,"params":[1,[["place2",0,[1,1]]],173199866315710],"hash":"13210760e20de99b8218be5cc465851fcb6aa74a"}',
                      //data: "{'jsonrpc':'2.0','method':'getPostList','id':1,'params':[1,[['place2',0,[1,1]]],173099135176724],'hash':'decfe7c9183f16efa1291f5131902f7d4ef4ff14'}",
                      cache: false,
                      processData: false,
                      success: function(msg) {
                      if (msg.d != "")
                      alert('salam');

                                  },
                                  error: function(xhr, errorType, exception) { //Triggered if an error communicating with server  
                                      var errorMessage = exception || xhr.statusText; //If exception null, then default to xhr.statusText  
                      
                                      alert("There was an error creating your contact: " + errorMessage);
                                  }
                              });
                          }
                      

                      </script>

                      I get this error now : There was an error creating your contact: NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://tehran.divar.ir/'.

                      T Offline
                      T Offline
                      thatraja
                      wrote on last edited by
                      #10

                      For different domain, you should use JSONP[^] EDIT


                      Someone posted a blogpost here on this topic, check it out Using jQuery Binding to make cross-domain calls with Closure Callbacks[^]

                      thatraja

                      Code converters | Education Needed | Improve EverythingNew

                      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