Skip to content

Instantly share code, notes, and snippets.

@ledangtuanbk
Created June 2, 2017 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ledangtuanbk/5e77cbcfd97c854854a310b256932359 to your computer and use it in GitHub Desktop.
Save ledangtuanbk/5e77cbcfd97c854854a310b256932359 to your computer and use it in GitHub Desktop.
test
result = [];
function load(url, level)
{
console.log("level: "+level+","+url);
$.get(url, function(data, status){
var x;
if($(data).length>2)
{
x=$($(data)[2]);
}
else
{
x = $($(data)[1]);
}
var a1 = x.find("a");
if(url.indexOf("DrugsID=")!=-1)
{
debugger;
result.push(data);
}
else
{
a1.each(function( index ) {
load("http://thuoc.net.vn/Ajax/"+$(this).attr("href")+"&AjaxRequestUniqueId=14956777706050", level+1);
});
}
});
}
load("http://thuoc.net.vn/Ajax/Default.aspx?Mod=ClassifyDrugs&AjaxRequestUniqueId=14956777706050", 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment