Website scraping using jquery and ajax

前端 未结 6 1758
孤独总比滥情好
孤独总比滥情好 2020-12-24 09:46

I want to be able to manipulate the html of a given url. Something like html scraping. I know this can be done using curl or some scraping library.But i would like to know i

6条回答
  •  鱼传尺愫
    2020-12-24 10:27

    Its not that difficult.

    $(document).ready(function() {
      baseUrl = "http://www.somedomain.com/";
      $.ajax({
        url: baseUrl,
        type: "get",
        dataType: "",
        success: function(data) {
          //do something with data
        }
      });
    });
    

    I think this can give you a good clue - http://jsfiddle.net/skelly/m4QCt/

提交回复
热议问题