Q: questions about data collection-content is dynamically loaded by AJAX

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.