Q: data collection problems-content is dynamically loaded by AJAX. Recently, I have been reading PHP Data collection knowledge, but I encountered a major difficulty in collecting some website content, for example, the weekly ranking of Dangdang: bang. dangdang. on the combookbestSeller page, the list data is also obtained by AJAX, and the source code cannot be directly obtained for analysis. I track that the content is obtained by loading the following AJAX code: & nbsp; dynamic call q: data collection problems-content is dynamically loaded by AJAX
I have been reading PHP Data collection recently, but encountered a major difficulty in collecting some website content. for example, on Dangdang's weekly ranking: bang.dangdang.com/book/bestSeller/ page, these list data is also obtained by AJAX, and the source code cannot be directly obtained for analysis. I track that the obtained content is loaded by the following AJAX code:
// Dynamically call the content on the right
$. Ajax ({
Url: "contentList. php? Catpath = "+ strCatPath +" & type = "+ strType +" & year = "+ strYear +" & month = "+ strMonth +" & range = "+ strRange,
Cache: false,
Type: "POST ",
Data: "catTitleName =" + catTitleName + "& catTitleOther =" + catTitleOther,
Success: function (html ){
$ ("# PContentDateList" ).css ("display", "none ");
$ ("# PContentDateList" ).html (html );
$ ("# PContentDateList"). fadeIn ("slow ");
}
});
The contents of these lists are from contentList. php: The Returned content is in the html variable. what should I do next? I also write a request contentList locally. php AJAX file, or get the html value before data collection
That is to say, the data collection method for pages dynamically loaded by AJAX:
1. write a JS file by yourself and request its server script to obtain the returned content.
2. obtain the returned content.
In practice, what kind of application is used? how can I obtain it? I am very grateful to my brother and sister for asking me to teach me.
------ Solution --------------------
You need to write contentList. php to retrieve the collected content.
You can use cURL to add a regular expression.
------ Solution --------------------
The source program should use AJAX to obtain user information and transmit it to contentList. php for further processing. do some processing for any information. After the processing result is returned to the page, the page responds.